#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)
}
#endif
+#ifdef __cplusplus
+}
+#endif
+
#if SIDE_BITS_PER_LONG == 64
# define side_bswap_pointer(x) side_bswap_64(x)
#else