]> git.draconx.ca Git - cdecl99.git/blobdiff - src/cdecl.h
libcdecl: Replace uintmax_t with unsigned (long) long.
[cdecl99.git] / src / cdecl.h
index 63034f4bf11d946bbb9fb98bb66ffc7f92a66343..952b0aab6020a6b4a5bc68cf6b12356d2bc77026 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2011, 2021, 2023 Nick Bowler
+ * Copyright © 2011, 2021, 2023-2024 Nick Bowler
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,8 +18,7 @@
 #ifndef CDECL_H_
 #define CDECL_H_
 
-#include <stddef.h>
-#include <stdint.h>
+#include <stddef.h> /* for size_t */
 
 #if __GNUC__
 #  define CDECL__INLINE __inline
@@ -34,6 +33,12 @@ typedef _Bool cdecl_bool;
 typedef signed char cdecl_bool;
 #endif
 
+#if HAVE_UNSIGNED_LONG_LONG_INT
+typedef unsigned long long cdecl_uintmax;
+#else
+typedef unsigned long cdecl_uintmax;
+#endif
+
 /* Declaration specifier kinds. */
 enum {
        CDECL_SPEC_TYPE = 256,
@@ -98,7 +103,7 @@ struct cdecl {
                        } pointer;
                        struct cdecl_array {
                                char *vla;
-                               uintmax_t length;
+                               cdecl_uintmax length;
                        } array;
                        struct cdecl_function {
                                struct cdecl *parameters;