summaryrefslogtreecommitdiff
path: root/vendor/tree-sitter/lib/src/host.h
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/tree-sitter/lib/src/host.h')
-rw-r--r--vendor/tree-sitter/lib/src/host.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/vendor/tree-sitter/lib/src/host.h b/vendor/tree-sitter/lib/src/host.h
new file mode 100644
index 0000000..a07e9f8
--- /dev/null
+++ b/vendor/tree-sitter/lib/src/host.h
@@ -0,0 +1,21 @@
1
2// Determine endian and pointer size based on known defines.
3// TS_BIG_ENDIAN and TS_PTR_SIZE can be set as -D compiler arguments
4// to override this.
5
6#if !defined(TS_BIG_ENDIAN)
7#if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) \
8 || (defined( __APPLE_CC__) && (defined(__ppc__) || defined(__ppc64__)))
9#define TS_BIG_ENDIAN 1
10#else
11#define TS_BIG_ENDIAN 0
12#endif
13#endif
14
15#if !defined(TS_PTR_SIZE)
16#if UINTPTR_MAX == 0xFFFFFFFF
17#define TS_PTR_SIZE 32
18#else
19#define TS_PTR_SIZE 64
20#endif
21#endif