[lttng-dev] [Babeltrace RFC PATCH 07/28] Add MinGW specific definitions to endian.h

Ikaheimonen, JP jp_ikaheimonen at mentor.com
Thu May 2 07:48:09 EDT 2013


---
 include/babeltrace/endian.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/include/babeltrace/endian.h b/include/babeltrace/endian.h
index 9eee0c1..f15a44f 100644
--- a/include/babeltrace/endian.h
+++ b/include/babeltrace/endian.h
@@ -29,6 +29,22 @@
 
 #ifdef __FreeBSD__
 #include <machine/endian.h>
+#elif defined(__MINGW32__)
+#ifndef __BIG_ENDIAN
+#define __BIG_ENDIAN 4321
+#endif
+#ifndef __LITTLE_ENDIAN
+#define __LITTLE_ENDIAN 1234
+#endif
+
+#ifndef __BYTE_ORDER
+#define __BYTE_ORDER __LITTLE_ENDIAN
+#endif
+
+#define LITTLE_ENDIAN  __LITTLE_ENDIAN
+#define BIG_ENDIAN     __BIG_ENDIAN
+#define PDP_ENDIAN     __PDP_ENDIAN
+#define BYTE_ORDER     __BYTE_ORDER
 #else
 #include <endian.h>
 #endif
-- 
1.8.1.msysgit.1




More information about the lttng-dev mailing list