summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-01-05 00:46:51 +0100
committerAraq <rumpf_a@web.de>2012-01-05 00:46:51 +0100
commit8aa4e4670716f04e6029c24b052c09a4a3cc0ae4 (patch)
tree03d0cf61161cd8f2bf21324b77b5ec3fab6ae17e /lib
parent9152193e41c83b1dda3f34e6a630acbf1e1a0134 (diff)
downloadNim-8aa4e4670716f04e6029c24b052c09a4a3cc0ae4.tar.gz
implemented incompleteStruct pragma; embedded debugger works with posix module
Diffstat (limited to 'lib')
-rwxr-xr-xlib/nimbase.h6
-rwxr-xr-xlib/posix/posix.nim15
-rwxr-xr-xlib/system/alloc.nim4
3 files changed, 20 insertions, 5 deletions
diff --git a/lib/nimbase.h b/lib/nimbase.h
index e2afed8f9..f52185800 100755
--- a/lib/nimbase.h
+++ b/lib/nimbase.h
@@ -1,7 +1,7 @@
 /*
 
             Nimrod's Runtime Library
-        (c) Copyright 2011 Andreas Rumpf
+        (c) Copyright 2012 Andreas Rumpf
 
     See the file "copying.txt", included in this
     distribution, for details about the copyright.
@@ -438,7 +438,9 @@ __declspec(naked) int __fastcall NimXadd(volatile int* pNum, int val) {
 #  define unlikely(x) (x)
 #endif
 
-#if defined(__GNUC__) || defined(__clang__)
+#if 0 // defined(__GNUC__) || defined(__clang__)
+// not needed anymore because the stack marking cares about
+// interior pointers now
 static inline void GCGuard (void *ptr) { asm volatile ("" :: "X" (ptr)); }
 #  define GC_GUARD __attribute__ ((cleanup(GCGuard)))
 #else
diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim
index 58801d83e..f8d49ddb4 100755
--- a/lib/posix/posix.nim
+++ b/lib/posix/posix.nim
@@ -68,10 +68,19 @@ const
   STDIN_FILENO* = 0  ## File number of stdin;
   STDOUT_FILENO* = 1 ## File number of stdout; 
 
+when defined(endb):
+  # to not break bootstrapping again ...
+  type
+    TDIR* {.importc: "DIR", header: "<dirent.h>", 
+            final, pure, incompleteStruct.} = object
+      ## A type representing a directory stream. 
+else:
+  type
+    TDIR* {.importc: "DIR", header: "<dirent.h>", 
+            final, pure.} = object
+      ## A type representing a directory stream.   
+  
 type
-  TDIR* {.importc: "DIR", header: "<dirent.h>", final, pure.} = object
-    ## A type representing a directory stream. 
-
   Tdirent* {.importc: "struct dirent", 
              header: "<dirent.h>", final, pure.} = object ## dirent_t struct
     d_ino*: TIno  ## File serial number.
diff --git a/lib/system/alloc.nim b/lib/system/alloc.nim
index 8bf173fc1..c3478a739 100755
--- a/lib/system/alloc.nim
+++ b/lib/system/alloc.nim
@@ -683,6 +683,10 @@ proc getOccupiedMem(a: TMemRegion): int {.inline.} =
 # ---------------------- thread memory region -------------------------------
 
 template InstantiateForRegion(allocator: expr) =
+  when false:
+    proc interiorAllocatedPtr*(p: pointer): pointer =
+      result = interiorAllocatedPtr(allocator, p)
+
   proc deallocOsPages = deallocOsPages(allocator)
 
   proc alloc(size: int): pointer =