65 # define msleep(t) usleep((t) * 1000) |
65 # define msleep(t) usleep((t) * 1000) |
66 # endif |
66 # endif |
67 #endif |
67 #endif |
68 #endif /* _SLEEP_H */ |
68 #endif /* _SLEEP_H */ |
69 |
69 |
70 #ifdef __APPLE__ |
70 /* check compiler requirements */ /*FIXME*/ |
71 /* check compiler requirements */ |
|
72 #if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) |
71 #if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) |
73 #error Do not know the endianess of this architecture |
72 #warning __BIG_ENDIAN__ or __LITTLE_ENDIAN__ not found, going to set __LITTLE_ENDIAN__ as default |
74 #endif |
73 #define __LITTLE_ENDIAN__ 1 |
|
74 //#error Do not know the endianess of this architecture |
75 #endif |
75 #endif |
76 |
76 |
77 /* use byteswap macros from the host system, hopefully optimized ones ;-) |
77 /* use byteswap macros from the host system, hopefully optimized ones ;-) |
78 * or define our own version, simple, stupid, straight-forward... */ |
78 * or define our own version, simple, stupid, straight-forward... */ |
79 #ifdef HAVE_BYTESWAP_H |
79 #ifdef HAVE_BYTESWAP_H |
80 #include <byteswap.h> |
80 #include <byteswap.h> |
81 #else |
81 #else |
82 #define bswap_16(x) ((((x) & 0xFF00) >> 8) | (((x) & 0x00FF) << 8)) |
82 #define bswap_16(x) ((((x) & 0xFF00) >> 8) | (((x) & 0x00FF) << 8)) |
83 #define bswap_32(x) ((((x) & 0xFF000000) >> 24) | (((x) & 0x00FF0000) >> 8) | \ |
83 #define bswap_32(x) ((((x) & 0xFF000000) >> 24) | (((x) & 0x00FF0000) >> 8) | \ |
84 (((x) & 0x0000FF00) << 8) | (((x) & 0x000000FF) << 24) ) |
84 (((x) & 0x0000FF00) << 8) | (((x) & 0x000000FF) << 24) ) |
85 #endif /* HAVE_BYTESWAP_H */ |
85 #endif /* HAVE_BYTESWAP_H */ |
86 |
86 |
87 /* swap numbers accordingly to architecture automatically */ |
87 /* swap numbers accordingly to architecture automatically */ |
88 #ifdef __LITTLE_ENDIAN__ |
88 #ifdef __LITTLE_ENDIAN__ |
89 #define ENDIAN_LITTLE_32(x) x |
89 #define ENDIAN_LITTLE_32(x) x |