summaryrefslogtreecommitdiff
path: root/src/tree.h
diff options
context:
space:
mode:
authorKonstantin Podsvirov <konstantin@podsvirov.pro>2018-05-12 12:31:27 +0300
committerKonstantin Podsvirov <konstantin@podsvirov.pro>2018-05-12 12:31:27 +0300
commit63224902a50c68b3ce4e38827199bae4d50746f3 (patch)
tree5a60588d11d209ce20f01c94a46ea41cd53c324f /src/tree.h
parenta6920ce0f199c772ede76f0ae475cbf99d9f58bf (diff)
downloadcolm-63224902a50c68b3ce4e38827199bae4d50746f3.tar.gz
The type word_t declaration
If sizeof(unsigned long) == sizeof(void *) then word_t is unsigned long. Else if sizeof(unsigned long long) == sizeof(void *) then word_t is unsigned long long. Compilation checked with MSYS2 toolchains via Autotools project and with MinGW-w64 toolchains via CMake project.
Diffstat (limited to 'src/tree.h')
-rw-r--r--src/tree.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/tree.h b/src/tree.h
index 33e7aabf..4c50d4ea 100644
--- a/src/tree.h
+++ b/src/tree.h
@@ -31,11 +31,18 @@ extern "C" {
#include <colm/type.h>
#include <colm/input.h>
#include <colm/internal.h>
+#include <colm/defs.h>
#define COLM_INDENT_OFF -1
typedef unsigned char code_t;
-typedef unsigned long word_t;
+#if SIZEOF_UNSIGNED_LONG == SIZEOF_VOID_P
+ typedef unsigned long word_t;
+#elif SIZEOF_UNSIGNED_LONG_LONG == SIZEOF_VOID_P
+ typedef unsigned long long word_t;
+#else
+ #error "The type word_t was not declared"
+#endif
typedef unsigned long half_t;
struct bindings;