summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/nimbase.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/nimbase.h b/lib/nimbase.h
index 71f3b0d7c..c1dbc39d1 100755
--- a/lib/nimbase.h
+++ b/lib/nimbase.h
@@ -337,6 +337,24 @@ typedef long long int NI64;
 typedef unsigned int NU32;
 #endif
 
+#ifdef NIM_INTBITS
+#  if NIM_INTBITS == 64
+typedef NI64 NI;
+typedef NU64 NU;
+#  elif NIM_INTBITS == 32
+typedef NI32 NI;
+typedef NU32 NU;
+#  elif NIM_INTBITS == 16
+typedef NI16 NI;
+typedef NU16 NU;
+#  elif NIM_INTBITS == 8
+typedef NI8 NI;
+typedef NU8 NU;
+#  else
+#    error "invalid bit width for int"
+#  endif
+#endif
+
 extern NI nim_program_result;
 
 typedef float NF32;