[Lldb-commits] PATCH: NetBSD support in include/lldb/lldb-enumerations.h

Krister Walfridsson krister.walfridsson at gmail.com
Wed Jul 28 14:59:05 PDT 2010


The attached patch adds support for the NetBSD byte order macros in
include/lldb/lldb-enumerations.h.

    /Krister
-------------- next part --------------
Index: include/lldb/lldb-enumerations.h
===================================================================
--- include/lldb/lldb-enumerations.h	(revision 109645)
+++ include/lldb/lldb-enumerations.h	(working copy)
@@ -10,8 +10,12 @@
 #ifndef LLDB_enumerations_h_
 #define LLDB_enumerations_h_
 
-#if !defined (__APPLE__)
+#if defined (__NetBSD__)
 
+#include <sys/endian.h>
+
+#elif !defined (__APPLE__)
+
 #include <endian.h>
 
 #endif
@@ -94,8 +98,22 @@
 #error unable to detect endianness
 #endif
 
+#elif defined (__NetBSD__)
+
+// On NetBSD we rely upon the defines in <sys/endian.h>
+
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+    eByteOrderHost      = eByteOrderLittle
+#elif _BYTE_ORDER == _BIG_ENDIAN
+    eByteOrderHost      = eByteOrderBig
+#elif _BYTE_ORDER == _PDP_ENDIAN
+    eByteOrderHost      = eByteOrderPDP
 #else
+#error unable to detect endianness
+#endif
 
+#else
+
 // On linux we rely upon the defines in <endian.h>
 
 #if __BYTE_ORDER == __LITTLE_ENDIAN


More information about the lldb-commits mailing list