diff options
author | Araq <rumpf_a@web.de> | 2014-10-26 19:54:43 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-10-26 19:54:43 +0100 |
commit | 7a48942719f4a557abafefd6d5cbd8b25a283e3a (patch) | |
tree | 78e65172c02a0d2bde9d18aabbc699d575849b65 /lib | |
parent | fdf996925b6b23e3127ce699c976e9e07bdfe13f (diff) | |
download | Nim-7a48942719f4a557abafefd6d5cbd8b25a283e3a.tar.gz |
nicer error messages (untested)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/core/typeinfo.nim | 1 | ||||
-rw-r--r-- | lib/impure/zipfiles.nim | 2 | ||||
-rw-r--r-- | lib/system.nim | 26 |
3 files changed, 18 insertions, 11 deletions
diff --git a/lib/core/typeinfo.nim b/lib/core/typeinfo.nim index 842a944e1..84281485f 100644 --- a/lib/core/typeinfo.nim +++ b/lib/core/typeinfo.nim @@ -13,6 +13,7 @@ {.push hints: off.} +include "system/inclrtl.nim" include "system/hti.nim" {.pop.} diff --git a/lib/impure/zipfiles.nim b/lib/impure/zipfiles.nim index 8e5c24b8b..c22294061 100644 --- a/lib/impure/zipfiles.nim +++ b/lib/impure/zipfiles.nim @@ -57,7 +57,7 @@ proc addFile*(z: var TZipArchive, dest, src: string) = ## may contain a path that will be created. assert(z.mode != fmRead) if not fileExists(src): - raise newException(EIO, "File '" & src & "' does not exist") + raise newException(IOError, "File '" & src & "' does not exist") var zipsrc = zip_source_file(z.w, src, 0, -1) if zipsrc == nil: #echo("Dest: " & dest) diff --git a/lib/system.nim b/lib/system.nim index 795203e4e..a9b4da77a 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -2030,16 +2030,17 @@ when not defined(nimrodVM) and hostOS != "standalone": ## returns an informative string about the GC's activity. This may be useful ## for tweaking. - proc GC_ref*[T](x: ref T) {.magic: "GCref", benign.} - proc GC_ref*[T](x: seq[T]) {.magic: "GCref", benign.} - proc GC_ref*(x: string) {.magic: "GCref", benign.} + # XXX mark these as 'locks: 0' once 0.10.0 has been released + proc GC_ref*[T](x: ref T) {.magic: "GCref", gcsafe.} + proc GC_ref*[T](x: seq[T]) {.magic: "GCref", gcsafe.} + proc GC_ref*(x: string) {.magic: "GCref", gcsafe.} ## marks the object `x` as referenced, so that it will not be freed until ## it is unmarked via `GC_unref`. If called n-times for the same object `x`, ## n calls to `GC_unref` are needed to unmark `x`. - proc GC_unref*[T](x: ref T) {.magic: "GCunref", benign.} - proc GC_unref*[T](x: seq[T]) {.magic: "GCunref", benign.} - proc GC_unref*(x: string) {.magic: "GCunref", benign.} + proc GC_unref*[T](x: ref T) {.magic: "GCunref", gcsafe.} + proc GC_unref*[T](x: seq[T]) {.magic: "GCunref", gcsafe.} + proc GC_unref*(x: string) {.magic: "GCunref", gcsafe.} ## see the documentation of `GC_ref`. template accumulateResult*(iter: expr) = @@ -2178,9 +2179,14 @@ when not declared(sysFatal): e.msg = message & arg raise e -proc getTypeInfo*[T](x: T): pointer {.magic: "GetTypeInfo", benign.} - ## get type information for `x`. Ordinary code should not use this, but - ## the `typeinfo` module instead. +when defined(nimlocks): + proc getTypeInfo*[T](x: T): pointer {.magic: "GetTypeInfo", gcsafe, locks: 0.} + ## get type information for `x`. Ordinary code should not use this, but + ## the `typeinfo` module instead. +else: + proc getTypeInfo*[T](x: T): pointer {.magic: "GetTypeInfo", gcsafe.} + ## get type information for `x`. Ordinary code should not use this, but + ## the `typeinfo` module instead. {.push stackTrace: off.} proc abs*(x: int): int {.magic: "AbsI", noSideEffect.} = @@ -2379,7 +2385,7 @@ when not defined(JS): #and not defined(NimrodVM): when not defined(booting): proc writeln*[Ty](f: File, x: varargs[Ty, `$`]) {.inline, - tags: [WriteIOEffect], benign.} + tags: [WriteIOEffect], gcsafe, locks: 0.} ## writes the values `x` to `f` and then writes "\n". ## May throw an IO exception. else: |