Browse Source

misc/byteorder.h: verify byte order info

ambrop7 14 years ago
parent
commit
5f7c96481c
1 changed files with 4 additions and 0 deletions
  1. 4 0
      misc/byteorder.h

+ 4 - 0
misc/byteorder.h

@@ -32,6 +32,10 @@
 #ifndef BADVPN_MISC_BYTEORDER_H
 #define BADVPN_MISC_BYTEORDER_H
 
+#if (defined(BADVPN_LITTLE_ENDIAN) + defined(BADVPN_BIG_ENDIAN)) != 1
+#error Unknown byte order or too many byte orders
+#endif
+
 #include <stdint.h>
 
 static uint16_t badvpn_reverse16 (uint16_t x)