]> www.ginac.de Git - cln.git/blobdiff - src/base/cl_macros.h
Replace CL_REQUIRE/CL_PROVIDE(cl_prin_globals) with portable code.
[cln.git] / src / base / cl_macros.h
index 8c160e9d5aa498214c38c1dd4720c82171349ada..60a39e956bf19d0caf59fe77cd9a9efb4d28913f 100644 (file)
@@ -4,6 +4,7 @@
 #define _CL_MACROS_H
 
 #include "cln/types.h"
+#include "cln/exception.h"
 
 // Concatenation of macroexpanded tokens.
 // Example:
 
 // Denotes a point where control flow can never arrive.
 // NOTREACHED
-  #define NOTREACHED  cl_notreached_abort(__FILE__,__LINE__);
-namespace cln {
-  nonreturning_function(extern,cl_notreached_abort, (const char* filename, int lineno));
-}  // namespace cln
+  #define NOTREACHED  throw notreached_exception(__FILE__,__LINE__);
 
 // Check an arithmetic expression.
 // ASSERT(expr)
@@ -152,7 +150,7 @@ namespace cln {
 
 // Return 2^n, n a constant expression.
 // Same as bit(n), but undefined if n<0 or n>={long_}long_bitsize.
-  #ifdef HAVE_FAST_LONGLONG
+  #if defined(HAVE_FAST_LONGLONG) || defined(intQsize)
     #define bitc(n)  (1ULL << (((n) >= 0 && (n) < long_long_bitsize) ? (n) : 0))
   #else
     #define bitc(n)  (1UL << (((n) >= 0 && (n) < long_bitsize) ? (n) : 0))
@@ -196,7 +194,7 @@ namespace cln {
     }
 
 // doconsttimes(count,statement);
-// führt statement count mal aus (count mal der Code!),
+// führt statement count mal aus (count mal der Code!),
 // wobei count eine constant-expression >=0, <=8 ist.
   #define doconsttimes(count_from_doconsttimes,statement_from_doconsttimes)  \
     { if (0 < (count_from_doconsttimes)) { statement_from_doconsttimes; } \
@@ -212,7 +210,7 @@ namespace cln {
 // DOCONSTTIMES(count,macroname);
 // ruft count mal den Macro macroname auf (count mal der Code!),
 // wobei count eine constant-expression >=0, <=8 ist.
-// Dabei bekommt macroname der Reihe nach die Werte 0,...,count-1 übergeben.
+// Dabei bekommt macroname der Reihe nach die Werte 0,...,count-1 übergeben.
   #define DOCONSTTIMES(count_from_DOCONSTTIMES,macroname_from_DOCONSTTIMES)  \
     { if (0 < (count_from_DOCONSTTIMES)) { macroname_from_DOCONSTTIMES((0 < (count_from_DOCONSTTIMES) ? 0 : 0)); } \
       if (1 < (count_from_DOCONSTTIMES)) { macroname_from_DOCONSTTIMES((1 < (count_from_DOCONSTTIMES) ? 1 : 0)); } \
@@ -267,9 +265,6 @@ public:                                                                     \
 // it's a shame!)
 #define init1(type,lvalue)  (void) new (&(lvalue)) type
 
-// MAYBE_INLINE normally expands to nothing.
-// Useful for including the implementation of some file inline into another.
-  #define MAYBE_INLINE
-  #define MAYBE_INLINE2
+#include "cl_maybe_inline.h"
 
 #endif /* _CL_MACROS_H */