diff options
author | Araq <rumpf_a@web.de> | 2010-09-13 00:52:44 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2010-09-13 00:52:44 +0200 |
commit | 866572e2e4601a1248e5ac78b151dc48fb483aa4 (patch) | |
tree | f38b3574eb66ed398d176175564eeb264bd96376 /lib/nimbase.h | |
parent | 030d46f21804d8dd82edf7d5d2875e8f034dd86a (diff) | |
download | Nim-866572e2e4601a1248e5ac78b151dc48fb483aa4.tar.gz |
fixes for exception handling; added system.compileOption
Diffstat (limited to 'lib/nimbase.h')
-rwxr-xr-x | lib/nimbase.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/nimbase.h b/lib/nimbase.h index 01c3ece20..983bb112d 100755 --- a/lib/nimbase.h +++ b/lib/nimbase.h @@ -177,10 +177,6 @@ __TINYC__ ** ** Fortunately the ISO C99 specifications define the functions lrint, lrintf, ** llrint and llrintf which fix this problem as a side effect. -** -** On Unix-like systems, the configure process should have detected the -** presence of these functions. If they weren't found we have to replace them -** here with a standard C cast. */ /* @@ -444,4 +440,12 @@ __declspec(naked) int __fastcall NimXadd(volatile int* pNum, int val) { } #endif +#ifdef __GNUC__ +# define likely(x) __builtin_expect(x, 1) +# define unlikely(x) __builtin_expect(x, 0) +#else +# define likely(x) (x) +# define unlikely(x) (x) +#endif + #endif |