From 0beff2244a3a73463844b814503bb32ddbf5c778 Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Sat, 3 Jan 2015 19:49:59 +0000 Subject: [PATCH] fixed some warnings, added debug template (compile with -d debug), make QtType macro pass through definitions we do not explicitly handle --- Nim/NimQml/NimQmlMacros.nim | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Nim/NimQml/NimQmlMacros.nim b/Nim/NimQml/NimQmlMacros.nim index 4cf4177..c89bf01 100644 --- a/Nim/NimQml/NimQmlMacros.nim +++ b/Nim/NimQml/NimQmlMacros.nim @@ -5,6 +5,14 @@ import strutils import typetraits import tables +template debug(body: stmt): stmt = + {.push warning[user]: off.} + when defined(debug): + {.pop.} + body + else: + {.pop.} + # these are defined in a template to work around a compiler bug # with {.compileTime.}/static variables not being "computable at # compile time" when a macro using them is imported into another @@ -30,7 +38,7 @@ proc getNodeOf*(tree: PNimrodNode, kind: TNimrodNodeKind): PNimrodNode {.compile ## Returnsthe first node that satisfies this condition for i in 0..