fixes DLL generation
This commit is contained in:
parent
b15f323f03
commit
5e839d50b4
7 changed files with 56 additions and 49 deletions
|
|
@ -730,7 +730,7 @@ proc retIsNotVoid(s: PSym): bool =
|
||||||
result = (s.typ.sons[0] != nil) and not isInvalidReturnType(s.typ.sons[0])
|
result = (s.typ.sons[0] != nil) and not isInvalidReturnType(s.typ.sons[0])
|
||||||
|
|
||||||
proc initFrame(p: BProc, procname, filename: PRope): PRope =
|
proc initFrame(p: BProc, procname, filename: PRope): PRope =
|
||||||
discard cgsym(p.module, "pushFrame")
|
discard cgsym(p.module, "nimFrame")
|
||||||
if p.maxFrameLen > 0:
|
if p.maxFrameLen > 0:
|
||||||
discard cgsym(p.module, "TVarSlot")
|
discard cgsym(p.module, "TVarSlot")
|
||||||
result = rfmt(nil, "\tnimfrs($1, $2, $3, $4)$N",
|
result = rfmt(nil, "\tnimfrs($1, $2, $3, $4)$N",
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ proc initDefines*() =
|
||||||
defineSymbol("nimcomputedgoto")
|
defineSymbol("nimcomputedgoto")
|
||||||
defineSymbol("nimunion")
|
defineSymbol("nimunion")
|
||||||
defineSymbol("nimnewshared")
|
defineSymbol("nimnewshared")
|
||||||
|
defineSymbol("nimrequiresnimframe")
|
||||||
|
|
||||||
# add platform specific symbols:
|
# add platform specific symbols:
|
||||||
case targetCPU
|
case targetCPU
|
||||||
|
|
|
||||||
|
|
@ -193,6 +193,47 @@ when defined(nimNewShared):
|
||||||
`shared`* {.magic: "Shared".}
|
`shared`* {.magic: "Shared".}
|
||||||
guarded* {.magic: "Guarded".}
|
guarded* {.magic: "Guarded".}
|
||||||
|
|
||||||
|
# comparison operators:
|
||||||
|
proc `==` *[TEnum: enum](x, y: TEnum): bool {.magic: "EqEnum", noSideEffect.}
|
||||||
|
proc `==` *(x, y: pointer): bool {.magic: "EqRef", noSideEffect.}
|
||||||
|
proc `==` *(x, y: string): bool {.magic: "EqStr", noSideEffect.}
|
||||||
|
proc `==` *(x, y: cstring): bool {.magic: "EqCString", noSideEffect.}
|
||||||
|
proc `==` *(x, y: char): bool {.magic: "EqCh", noSideEffect.}
|
||||||
|
proc `==` *(x, y: bool): bool {.magic: "EqB", noSideEffect.}
|
||||||
|
proc `==` *[T](x, y: set[T]): bool {.magic: "EqSet", noSideEffect.}
|
||||||
|
proc `==` *[T](x, y: ref T): bool {.magic: "EqRef", noSideEffect.}
|
||||||
|
proc `==` *[T](x, y: ptr T): bool {.magic: "EqRef", noSideEffect.}
|
||||||
|
proc `==` *[T: proc](x, y: T): bool {.magic: "EqProc", noSideEffect.}
|
||||||
|
|
||||||
|
proc `<=` *[TEnum: enum](x, y: TEnum): bool {.magic: "LeEnum", noSideEffect.}
|
||||||
|
proc `<=` *(x, y: string): bool {.magic: "LeStr", noSideEffect.}
|
||||||
|
proc `<=` *(x, y: char): bool {.magic: "LeCh", noSideEffect.}
|
||||||
|
proc `<=` *[T](x, y: set[T]): bool {.magic: "LeSet", noSideEffect.}
|
||||||
|
proc `<=` *(x, y: bool): bool {.magic: "LeB", noSideEffect.}
|
||||||
|
proc `<=` *[T](x, y: ref T): bool {.magic: "LePtr", noSideEffect.}
|
||||||
|
proc `<=` *(x, y: pointer): bool {.magic: "LePtr", noSideEffect.}
|
||||||
|
|
||||||
|
proc `<` *[TEnum: enum](x, y: TEnum): bool {.magic: "LtEnum", noSideEffect.}
|
||||||
|
proc `<` *(x, y: string): bool {.magic: "LtStr", noSideEffect.}
|
||||||
|
proc `<` *(x, y: char): bool {.magic: "LtCh", noSideEffect.}
|
||||||
|
proc `<` *[T](x, y: set[T]): bool {.magic: "LtSet", noSideEffect.}
|
||||||
|
proc `<` *(x, y: bool): bool {.magic: "LtB", noSideEffect.}
|
||||||
|
proc `<` *[T](x, y: ref T): bool {.magic: "LtPtr", noSideEffect.}
|
||||||
|
proc `<` *[T](x, y: ptr T): bool {.magic: "LtPtr", noSideEffect.}
|
||||||
|
proc `<` *(x, y: pointer): bool {.magic: "LtPtr", noSideEffect.}
|
||||||
|
|
||||||
|
template `!=` * (x, y: expr): expr {.immediate.} =
|
||||||
|
## unequals operator. This is a shorthand for ``not (x == y)``.
|
||||||
|
not (x == y)
|
||||||
|
|
||||||
|
template `>=` * (x, y: expr): expr {.immediate.} =
|
||||||
|
## "is greater or equals" operator. This is the same as ``y <= x``.
|
||||||
|
y <= x
|
||||||
|
|
||||||
|
template `>` * (x, y: expr): expr {.immediate.} =
|
||||||
|
## "is greater" operator. This is the same as ``y < x``.
|
||||||
|
y < x
|
||||||
|
|
||||||
include "system/inclrtl"
|
include "system/inclrtl"
|
||||||
|
|
||||||
const NoFakeVars* = defined(NimrodVM) ## true if the backend doesn't support \
|
const NoFakeVars* = defined(NimrodVM) ## true if the backend doesn't support \
|
||||||
|
|
@ -695,47 +736,6 @@ proc `-+-` *[T](x, y: set[T]): set[T] {.magic: "SymDiffSet", noSideEffect.}
|
||||||
## computes the symmetric set difference. This is the same as
|
## computes the symmetric set difference. This is the same as
|
||||||
## ``(A - B) + (B - A)``, but more efficient.
|
## ``(A - B) + (B - A)``, but more efficient.
|
||||||
|
|
||||||
# comparison operators:
|
|
||||||
proc `==` *[TEnum: enum](x, y: TEnum): bool {.magic: "EqEnum", noSideEffect.}
|
|
||||||
proc `==` *(x, y: pointer): bool {.magic: "EqRef", noSideEffect.}
|
|
||||||
proc `==` *(x, y: string): bool {.magic: "EqStr", noSideEffect.}
|
|
||||||
proc `==` *(x, y: cstring): bool {.magic: "EqCString", noSideEffect.}
|
|
||||||
proc `==` *(x, y: char): bool {.magic: "EqCh", noSideEffect.}
|
|
||||||
proc `==` *(x, y: bool): bool {.magic: "EqB", noSideEffect.}
|
|
||||||
proc `==` *[T](x, y: set[T]): bool {.magic: "EqSet", noSideEffect.}
|
|
||||||
proc `==` *[T](x, y: ref T): bool {.magic: "EqRef", noSideEffect.}
|
|
||||||
proc `==` *[T](x, y: ptr T): bool {.magic: "EqRef", noSideEffect.}
|
|
||||||
proc `==` *[T: proc](x, y: T): bool {.magic: "EqProc", noSideEffect.}
|
|
||||||
|
|
||||||
proc `<=` *[TEnum: enum](x, y: TEnum): bool {.magic: "LeEnum", noSideEffect.}
|
|
||||||
proc `<=` *(x, y: string): bool {.magic: "LeStr", noSideEffect.}
|
|
||||||
proc `<=` *(x, y: char): bool {.magic: "LeCh", noSideEffect.}
|
|
||||||
proc `<=` *[T](x, y: set[T]): bool {.magic: "LeSet", noSideEffect.}
|
|
||||||
proc `<=` *(x, y: bool): bool {.magic: "LeB", noSideEffect.}
|
|
||||||
proc `<=` *[T](x, y: ref T): bool {.magic: "LePtr", noSideEffect.}
|
|
||||||
proc `<=` *(x, y: pointer): bool {.magic: "LePtr", noSideEffect.}
|
|
||||||
|
|
||||||
proc `<` *[TEnum: enum](x, y: TEnum): bool {.magic: "LtEnum", noSideEffect.}
|
|
||||||
proc `<` *(x, y: string): bool {.magic: "LtStr", noSideEffect.}
|
|
||||||
proc `<` *(x, y: char): bool {.magic: "LtCh", noSideEffect.}
|
|
||||||
proc `<` *[T](x, y: set[T]): bool {.magic: "LtSet", noSideEffect.}
|
|
||||||
proc `<` *(x, y: bool): bool {.magic: "LtB", noSideEffect.}
|
|
||||||
proc `<` *[T](x, y: ref T): bool {.magic: "LtPtr", noSideEffect.}
|
|
||||||
proc `<` *[T](x, y: ptr T): bool {.magic: "LtPtr", noSideEffect.}
|
|
||||||
proc `<` *(x, y: pointer): bool {.magic: "LtPtr", noSideEffect.}
|
|
||||||
|
|
||||||
template `!=` * (x, y: expr): expr {.immediate.} =
|
|
||||||
## unequals operator. This is a shorthand for ``not (x == y)``.
|
|
||||||
not (x == y)
|
|
||||||
|
|
||||||
template `>=` * (x, y: expr): expr {.immediate.} =
|
|
||||||
## "is greater or equals" operator. This is the same as ``y <= x``.
|
|
||||||
y <= x
|
|
||||||
|
|
||||||
template `>` * (x, y: expr): expr {.immediate.} =
|
|
||||||
## "is greater" operator. This is the same as ``y < x``.
|
|
||||||
y < x
|
|
||||||
|
|
||||||
proc contains*[T](x: set[T], y: T): bool {.magic: "InSet", noSideEffect.}
|
proc contains*[T](x: set[T], y: T): bool {.magic: "InSet", noSideEffect.}
|
||||||
## One should overload this proc if one wants to overload the ``in`` operator.
|
## One should overload this proc if one wants to overload the ``in`` operator.
|
||||||
## The parameters are in reverse order! ``a in b`` is a template for
|
## The parameters are in reverse order! ``a in b`` is a template for
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ proc chckRange(i, a, b: int): int {.inline, compilerproc.}
|
||||||
proc chckRangeF(x, a, b: float): float {.inline, compilerproc.}
|
proc chckRangeF(x, a, b: float): float {.inline, compilerproc.}
|
||||||
proc chckNil(p: pointer) {.inline, compilerproc.}
|
proc chckNil(p: pointer) {.inline, compilerproc.}
|
||||||
|
|
||||||
proc pushFrame(s: PFrame) {.compilerRtl, inl, exportc: "nimFrame".} = discard
|
proc nimFrame(s: PFrame) {.compilerRtl, inl, exportc: "nimFrame".} = discard
|
||||||
proc popFrame {.compilerRtl, inl.} = discard
|
proc popFrame {.compilerRtl, inl.} = discard
|
||||||
|
|
||||||
proc setFrame(s: PFrame) {.compilerRtl, inl.} = discard
|
proc setFrame(s: PFrame) {.compilerRtl, inl.} = discard
|
||||||
|
|
|
||||||
|
|
@ -44,9 +44,15 @@ var
|
||||||
# a global variable for the root of all try blocks
|
# a global variable for the root of all try blocks
|
||||||
currException {.rtlThreadVar.}: ref E_Base
|
currException {.rtlThreadVar.}: ref E_Base
|
||||||
|
|
||||||
proc pushFrame(s: PFrame) {.compilerRtl, inl, exportc: "nimFrame".} =
|
when defined(nimRequiresNimFrame):
|
||||||
s.prev = framePtr
|
proc nimFrame(s: PFrame) {.compilerRtl, inl, exportc: "nimFrame".} =
|
||||||
framePtr = s
|
s.prev = framePtr
|
||||||
|
framePtr = s
|
||||||
|
else:
|
||||||
|
proc pushFrame(s: PFrame) {.compilerRtl, inl, exportc: "nimFrame".} =
|
||||||
|
# XXX only for backwards compatibility
|
||||||
|
s.prev = framePtr
|
||||||
|
framePtr = s
|
||||||
|
|
||||||
proc popFrame {.compilerRtl, inl.} =
|
proc popFrame {.compilerRtl, inl.} =
|
||||||
framePtr = framePtr.prev
|
framePtr = framePtr.prev
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,9 @@ when defined(createNimRtl):
|
||||||
{.pragma: inl.}
|
{.pragma: inl.}
|
||||||
{.pragma: compilerRtl, compilerproc, exportc: "nimrtl_$1", dynlib.}
|
{.pragma: compilerRtl, compilerproc, exportc: "nimrtl_$1", dynlib.}
|
||||||
elif defined(useNimRtl):
|
elif defined(useNimRtl):
|
||||||
when hostOS == "windows":
|
when defined(windows):
|
||||||
const nimrtl* = "nimrtl.dll"
|
const nimrtl* = "nimrtl.dll"
|
||||||
elif hostOS == "macosx":
|
elif defined(macosx):
|
||||||
const nimrtl* = "nimrtl.dylib"
|
const nimrtl* = "nimrtl.dylib"
|
||||||
else:
|
else:
|
||||||
const nimrtl* = "libnimrtl.so"
|
const nimrtl* = "libnimrtl.so"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<a class="news" href="news.html#Z2014-XX-XX-version-0-9-4-released">
|
<a class="news" href="news.html#Z2014-XX-XX-version-0-9-4-released">
|
||||||
<h3>Apr 20, 2014</h3>
|
<h3>Apr 21, 2014</h3>
|
||||||
<p>Nimrod version 0.9.4 has been released!</p>
|
<p>Nimrod version 0.9.4 has been released!</p>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue