summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xcompiler/cgen.nim11
-rwxr-xr-xcompiler/nimrod.cfg8
-rwxr-xr-xlib/pure/hashes.nim13
-rw-r--r--tests/compile/tglobalforvar.nim2
-rw-r--r--tests/reject/tenummix.nim2
-rwxr-xr-xtodo.txt7
6 files changed, 21 insertions, 22 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim
index 2c2230be9..c7bfced73 100755
--- a/compiler/cgen.nim
+++ b/compiler/cgen.nim
@@ -818,11 +818,11 @@ proc getFileHeader(cfilenoext: string): PRope =
 
 proc genMainProc(m: BModule) = 
   const 
-    CommonMainBody = 
-        "$1" &
+    CommonMainBody =
         "\tnim__datInit();$n" &
-        "\tsystemInit();$n" & 
-        "$2" & 
+        "\tsystemInit();$n" &
+        "$1" &
+        "$2" &
         "$3"
     PosixNimMain = 
         "int cmdCount;$n" & 
@@ -873,7 +873,8 @@ proc genMainProc(m: BModule) =
     otherMain = PosixCMain
   if gBreakpoints != nil: discard cgsym(m, "dbgRegisterBreakpoint")
   
-  let initStackBottomCall = if emulatedThreadVars(): "".toRope
+  let initStackBottomCall = if emulatedThreadVars() or
+                              platform.targetOS == osStandalone: "".toRope
                             else: ropecg(m, "\t#initStackBottom();$n")
   inc(m.labels)
   appcg(m, m.s[cfsProcs], nimMain, [initStackBottomCall,
diff --git a/compiler/nimrod.cfg b/compiler/nimrod.cfg
index f47143527..42a5ed5f5 100755
--- a/compiler/nimrod.cfg
+++ b/compiler/nimrod.cfg
@@ -6,10 +6,4 @@ path="$projectPath/.."
 
 path="$nimrod/packages/docutils"
 
-@if llvm_gcc or gcc:
-  # GCC, LLVM and Visual C++ have a problem to optimize some modules.
-  # This is really strange.
-  # cgen.speed = "-O0"
-@elif vcc:
-  # cgen.speed = ""
-@end
+--define:booting
diff --git a/lib/pure/hashes.nim b/lib/pure/hashes.nim
index 1249ff73b..9c086c675 100755
--- a/lib/pure/hashes.nim
+++ b/lib/pure/hashes.nim
@@ -67,12 +67,13 @@ proc hash*(x: Pointer): THash {.inline.} =
   else:
     result = (cast[THash](x)) shr 3 # skip the alignment
   
-proc hash*[T: proc](x: T): THash {.inline.} =
-  ## efficient hashing of proc vars; closures are supported too.
-  when T is "closure":
-    result = hash(rawProc(x)) !& hash(rawEnv(x))
-  else:
-    result = hash(pointer(x))
+when not defined(booting):
+  proc hash*[T: proc](x: T): THash {.inline.} =
+    ## efficient hashing of proc vars; closures are supported too.
+    when T is "closure":
+      result = hash(rawProc(x)) !& hash(rawEnv(x))
+    else:
+      result = hash(pointer(x))
   
 proc hash*(x: int): THash {.inline.} = 
   ## efficient hashing of integers
diff --git a/tests/compile/tglobalforvar.nim b/tests/compile/tglobalforvar.nim
index 9f61ebcab..af75df5c8 100644
--- a/tests/compile/tglobalforvar.nim
+++ b/tests/compile/tglobalforvar.nim
@@ -1,5 +1,5 @@
 
-var funcs: seq[proc (): int] = @[]
+var funcs: seq[proc (): int {.nimcall.}] = @[]
 for i in 0..10:
   funcs.add((proc (): int = return i * i))
 
diff --git a/tests/reject/tenummix.nim b/tests/reject/tenummix.nim
index c9ea9a8f8..35fd8527a 100644
--- a/tests/reject/tenummix.nim
+++ b/tests/reject/tenummix.nim
@@ -1,6 +1,6 @@
 discard """
   file: "system.nim"
-  line: 637
+  line: 638
   errormsg: "type mismatch"
 """
 
diff --git a/todo.txt b/todo.txt
index a23fe9250..15a26f75d 100755
--- a/todo.txt
+++ b/todo.txt
@@ -1,6 +1,8 @@
 version 0.9.0
 =============
 
+- fix DLLs
+- fix 'bind' for templates
 - implicit deref for parameter matching
 - deprecate ``var x, y = 0`` as it's confusing for tuple consistency
 
@@ -44,6 +46,9 @@ version 0.9.XX
 
 - make templates hygienic by default: try to gensym() everything in the 'block'
   of a template; find a better solution for gensym instead of `*ident`
+- introduce 'callsite' magic and make macros and templates the same
+- better support for macros that rewrite procs
+- macros need access to types and symbols
 - document nimdoc properly finally
 - make 'clamp' a magic for the range stuff
 - implement a warning message for shadowed 'result' variable
@@ -86,8 +91,6 @@ Library
 - locale support; i18n module
 - bignums
 
-- pdcurses bindings
-
 
 Low priority
 ------------