Explorar o código

Add a endianness check to _hashindex.c until the code is big endian safe

Jonas Borgström %!s(int64=12) %!d(string=hai) anos
pai
achega
0b697117ba
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      darc/_hashindex.c

+ 4 - 0
darc/_hashindex.c

@@ -9,6 +9,10 @@
 #include <unistd.h>
 #include <unistd.h>
 #include <sys/mman.h>
 #include <sys/mman.h>
 
 
+#if defined(__BYTE_ORDER__)&&(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
+#error This code is not big endian safe yet
+#endif
+
 typedef struct {
 typedef struct {
     char magic[8];
     char magic[8];
     int32_t num_entries;
     int32_t num_entries;