implemented incompleteStruct pragma; embedded debugger works with posix module
This commit is contained in:
parent
9152193e41
commit
8aa4e46707
19 changed files with 85 additions and 47 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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 =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue