attempt to fix DLL generation

This commit is contained in:
Araq
2012-07-18 00:02:53 +02:00
parent 832da8a303
commit 83deb233ee
6 changed files with 21 additions and 22 deletions

View File

@@ -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,

View File

@@ -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

View File

@@ -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

View File

@@ -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))

View File

@@ -1,6 +1,6 @@
discard """
file: "system.nim"
line: 637
line: 638
errormsg: "type mismatch"
"""

View File

@@ -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
------------