diff --git a/compiler/cgen.nim b/compiler/cgen.nim index f64ebacfb1..8d66d7a3b1 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -730,7 +730,7 @@ proc retIsNotVoid(s: PSym): bool = result = (s.typ.sons[0] != nil) and not isInvalidReturnType(s.typ.sons[0]) proc initFrame(p: BProc, procname, filename: PRope): PRope = - discard cgsym(p.module, "pushFrame") + discard cgsym(p.module, "nimFrame") if p.maxFrameLen > 0: discard cgsym(p.module, "TVarSlot") result = rfmt(nil, "\tnimfrs($1, $2, $3, $4)$N", diff --git a/compiler/condsyms.nim b/compiler/condsyms.nim index 4117fc461d..17bb5db55a 100644 --- a/compiler/condsyms.nim +++ b/compiler/condsyms.nim @@ -49,6 +49,7 @@ proc initDefines*() = defineSymbol("nimcomputedgoto") defineSymbol("nimunion") defineSymbol("nimnewshared") + defineSymbol("nimrequiresnimframe") # add platform specific symbols: case targetCPU diff --git a/lib/system.nim b/lib/system.nim index 273820b825..4a5d46a7f6 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -193,6 +193,47 @@ when defined(nimNewShared): `shared`* {.magic: "Shared".} 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" 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 ## ``(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.} ## 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 diff --git a/lib/system/embedded.nim b/lib/system/embedded.nim index 85fe17f8dd..661992e812 100644 --- a/lib/system/embedded.nim +++ b/lib/system/embedded.nim @@ -15,7 +15,7 @@ proc chckRange(i, a, b: int): int {.inline, compilerproc.} proc chckRangeF(x, a, b: float): float {.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 setFrame(s: PFrame) {.compilerRtl, inl.} = discard diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim index 612a9e729f..2f7c5ed514 100644 --- a/lib/system/excpt.nim +++ b/lib/system/excpt.nim @@ -44,9 +44,15 @@ var # a global variable for the root of all try blocks currException {.rtlThreadVar.}: ref E_Base -proc pushFrame(s: PFrame) {.compilerRtl, inl, exportc: "nimFrame".} = - s.prev = framePtr - framePtr = s +when defined(nimRequiresNimFrame): + proc nimFrame(s: PFrame) {.compilerRtl, inl, exportc: "nimFrame".} = + 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.} = framePtr = framePtr.prev diff --git a/lib/system/inclrtl.nim b/lib/system/inclrtl.nim index 475a096869..12eb90162c 100644 --- a/lib/system/inclrtl.nim +++ b/lib/system/inclrtl.nim @@ -30,9 +30,9 @@ when defined(createNimRtl): {.pragma: inl.} {.pragma: compilerRtl, compilerproc, exportc: "nimrtl_$1", dynlib.} elif defined(useNimRtl): - when hostOS == "windows": + when defined(windows): const nimrtl* = "nimrtl.dll" - elif hostOS == "macosx": + elif defined(macosx): const nimrtl* = "nimrtl.dylib" else: const nimrtl* = "libnimrtl.so" diff --git a/web/ticker.txt b/web/ticker.txt index a4ddddbbe6..691a14575f 100644 --- a/web/ticker.txt +++ b/web/ticker.txt @@ -1,5 +1,5 @@ -

Apr 20, 2014

+

Apr 21, 2014

Nimrod version 0.9.4 has been released!