Enforce ABI size checks
[libside.git] / include / side / endian.h
index a9680cac6f33c84d6ac5812fa3b1d2d10d4c8df9..c89d486c22decba87bf5204287b99b2ee94ed00b 100644 (file)
 #ifndef _SIDE_ENDIAN_H
 #define _SIDE_ENDIAN_H
 
-#include <side/macros.h>
 #include <math.h>
 
+#if defined(__SIZEOF_LONG__)
+# define SIDE_BITS_PER_LONG    (__SIZEOF_LONG__ * 8)
+#elif defined(_LP64)
+# define SIDE_BITS_PER_LONG    64
+#else
+# define SIDE_BITS_PER_LONG    32
+#endif
+
 #if (defined(__linux__) || defined(__CYGWIN__))
 #include <endian.h>
 #include <byteswap.h>
 #error "Please add support for your OS."
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef __HAVE_FLOAT128
 static inline
 void side_bswap_128p(char *p)
@@ -78,6 +89,10 @@ void side_bswap_128p(char *p)
 }
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #if SIDE_BITS_PER_LONG == 64
 # define side_bswap_pointer(x) side_bswap_64(x)
 #else
This page took 0.022163 seconds and 4 git commands to generate.