added nimlib/posix

This commit is contained in:
Andreas Rumpf 2009-12-10 00:50:09 +01:00
commit 033c28f111
3 changed files with 2448 additions and 7 deletions

2444
nimlib/posix/posix.nim Executable file

File diff suppressed because it is too large Load diff

View file

@ -46,7 +46,7 @@ type
TCFileSections = array[TCFileSection, PRope] # represents a generated C file TCFileSections = array[TCFileSection, PRope] # represents a generated C file
TCProcSection = enum # the sections a generated C proc consists of TCProcSection = enum # the sections a generated C proc consists of
cpsLocals, # section of local variables for C proc cpsLocals, # section of local variables for C proc
cpsInit, # section for initialization of variables for C proc cpsInit, # section for init of variables for C proc
cpsStmts # section of local statements for C proc cpsStmts # section of local statements for C proc
TCProcSections = array[TCProcSection, PRope] # represents a generated C proc TCProcSections = array[TCProcSection, PRope] # represents a generated C proc
BModule = ref TCGen BModule = ref TCGen
@ -114,18 +114,14 @@ proc appff(dest: var PRope, cformat, llvmformat: string,
else: appf(dest, cformat, args) else: appf(dest, cformat, args)
proc addForwardedProc(m: BModule, prc: PSym) = proc addForwardedProc(m: BModule, prc: PSym) =
var L = len(m.forwardedProcs) m.forwardedProcs.add(prc)
setlen(m.forwardedProcs, L + 1)
m.forwardedProcs[L] = prc
inc(gForwardedProcsCounter) inc(gForwardedProcsCounter)
proc addPendingModule(m: BModule) = proc addPendingModule(m: BModule) =
for i in countup(0, high(gPendingModules)): for i in countup(0, high(gPendingModules)):
if gPendingModules[i] == m: if gPendingModules[i] == m:
InternalError("module already pending: " & m.module.name.s) InternalError("module already pending: " & m.module.name.s)
var L = len(gPendingModules) gPendingModules.add(m)
setlen(gPendingModules, L + 1)
gPendingModules[L] = m
proc findPendingModule(m: BModule, s: PSym): BModule = proc findPendingModule(m: BModule, s: PSym): BModule =
var ms = getModule(s) var ms = getModule(s)

View file

@ -90,6 +90,7 @@ Files: "examples/*.tmpl"
Files: "bin/nimrod.exe" Files: "bin/nimrod.exe"
Files: "koch.exe" Files: "koch.exe"
Files: "dist/mingw" Files: "dist/mingw"
Files: "start.bat"
BinPath: r"bin;dist\mingw\bin" BinPath: r"bin;dist\mingw\bin"
InnoSetup: "Yes" InnoSetup: "Yes"