From 866572e2e4601a1248e5ac78b151dc48fb483aa4 Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 13 Sep 2010 00:52:44 +0200 Subject: fixes for exception handling; added system.compileOption --- lib/nimbase.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib/nimbase.h') 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 -- cgit 1.4.1-2-gfad0