shallot v0.0.3 from taswebqlseworuhc.onion.
[shallot/rransom.git] / src / linux.h
blob8d797da994fb06568d409e92f716200b5b397567
1 #ifndef LINUX_H
2 #define LINUX_H
4 #include "config.h"
6 #if defined(LINUX_PORT) || defined(OSX) || defined(GENERIC)
8 #include <stdint.h>
10 #if defined(OSX) || defined(GENERIC)
11 #include <arpa/inet.h>
12 #else
13 #include <endian.h>
14 #include <netinet/in.h>
15 #endif
17 #if BYTE_ORDER == BIG_ENDIAN
18 #warning Compiling for a BIG_ENDIAN system.
19 #define htobe64(x) (x)
20 #define htobe16(x) (x)
22 #elif BYTE_ORDER == LITTLE_ENDIAN
23 #warning Compiling for a LITTLE_ENDIAN system.
24 #define htobe64(x) (((uint64_t)htonl(x) << 32) | htonl(x >> 32))
25 #define htobe16(x) htons(x)
27 #else
28 #error Sell your PDP.
29 #endif
31 #ifdef LINUX_PORT
32 uint8_t parse_cpuinfo(char *buf, uint16_t avail, uint16_t *used);
33 #endif
35 #endif // defined(LINUX_PORT) || defined(OSX) || defined(GENERIC)
37 #endif