]> www.ginac.de Git - cln.git/blobdiff - include/cln/modules.h
* Change all C include headers to ISO style within C++ code.
[cln.git] / include / cln / modules.h
index b7ff435cacdae2fc26c731ee1e1de9cbbb563f48..26fc291c01cf8e2c69be92ab81531d495e27b799 100644 (file)
@@ -7,7 +7,7 @@
 // specified in C++. AIX 4 has a linker which apparently does order
 // the modules according to dependencies, so that low-level modules
 // will be initialized earlier than the high-level modules which depend
-// on them. I have a patch for GNU ld that does the same thing.
+// on them. I (Bruno) have a patch for GNU ld that does the same thing.
 //
 // But for now, I take a half-automatic approach to the correct module
 // ordering problem: PROVIDE/REQUIRE, as in Common Lisp.
@@ -64,7 +64,7 @@
   #endif
   // Globalize a label defined in the same translation unit.
   // See macro ASM_GLOBALIZE_LABEL in the gcc sources.
-  #if defined(__i386__) || defined(__m68k__) || defined(__mips__) || defined(__mips64__) || defined(__alpha__) || defined(__rs6000__) || defined(__s390__)
+  #if defined(__i386__) || defined(__m68k__) || defined(__mips__) || defined(__mips64__) || defined(__alpha__) || defined(__rs6000__) || defined(__x86_64__) || defined(__s390__)
     // Some m68k systems use "xdef" or "global" or ".global"...
     #define CL_GLOBALIZE_LABEL(label)  __asm__("\t.globl " label);
   #endif
   // except that the latter inhibits inlining of the function containing it
   // in gcc-2.95. For new CPUs, look for "jump" and "indirect_jump" in gcc's
   // machine description.
-  #if defined(__i386__)
+  #if defined(__i386__) || defined(__x86_64__)
     #define CL_JUMP_TO(addr)  ASM_VOLATILE("jmp %*%0" : : "rm" ((void*)(addr)))
   #endif
   #if defined(__m68k__)
   #define CL_REQUIRE(module)
 #endif
 
+// Concatenation of macroexpanded tokens.
+// Equivalent to CL_CONCAT in src/base/cl_macros.h which we do not want
+// to expose, however.
+#define CL_CONCATENATE_(xxx,yyy)  xxx##yyy
+#define CL_CONCATENATE(xxx,yyy)  CL_CONCATENATE_(xxx,yyy)
+
 // Sometimes a link time dependency is needed, but without requirements
 // on initialization order.
 //
 // CL_FORCE_LINK(dummy,external_variable)
 // forces a link time reference to the external_variable.
-#include <stdlib.h>
+#include <cstdlib>
 #if 0
 // This definition does not work.  It gets optimized away by g++ 3.1.
 #define CL_FORCE_LINK(dummy,external_variable) \
         abort();                                                       \
     }                                                                  \
   }                                                                    \
-  dummy##_instance;
+  CL_CONCATENATE(dummy,_instance);
 #endif
 
 #endif /* _CL_MODULES_H */