summaryrefslogtreecommitdiffstats
path: root/protocol.h
diff options
context:
space:
mode:
authorFinn Behrens <me@kloenk.de>2021-02-27 12:37:15 +0100
committerFinn Behrens <me@kloenk.de>2021-02-27 12:37:15 +0100
commit439def472015ac5ec5d5a65f9b5b95d21d8248ff (patch)
tree3ff031fedec57e6a86aeefe71e0940abcc3e5b6a /protocol.h
parentac7ec2b32226703d08bc4e47680e6bc59afa9b5c (diff)
downloadmcc-439def472015ac5ec5d5a65f9b5b95d21d8248ff.tar.gz
mcc-439def472015ac5ec5d5a65f9b5b95d21d8248ff.tar.xz
mcc-439def472015ac5ec5d5a65f9b5b95d21d8248ff.zip
package rewrite
Diffstat (limited to 'protocol.h')
-rw-r--r--protocol.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/protocol.h b/protocol.h
index edb2881..a73b4cf 100644
--- a/protocol.h
+++ b/protocol.h
@@ -14,7 +14,8 @@
#include <stdio.h>
#include <errno.h>
-#define PROTOCOL_VERSION 9
+// FIXME: find real version number
+#define PROTOCOL_VERSION 1073741839
// MARK: - Helpers
#if defined(__APPLE__)
@@ -26,18 +27,22 @@
#include <byteswap.h>
#endif
-#if __BYTE_ORDER == __BIG_ENDIAN
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#define BE16_TO_H(x) (x)
#define BE32_TO_H(x) (x)
#define BE64_TO_H(x) (x)
+#define H_TO_BE16(x) (x)
#define H_TO_BE32(x) (x)
+#define H_TO_BE64(x) (x)
#else
#define BE16_TO_H(x) bswap_16(x)
#define BE32_TO_H(x) bswap_32(x)
#define BE64_TO_H(x) bswap_64(x)
+#define H_TO_BE16(x) bswap_16(x)
#define H_TO_BE32(x) bswap_32(x)
+#define H_TO_BE64(x) bswap_64(x)
#endif
#define pos_bufferx(x, y) ((x + y))