Explorar el Código

misc/byteorder.h: verify byte order info

ambrop7 hace 14 años
padre
commit
5f7c96481c
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  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)