summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-07-28 17:28:36 +0200
committerAraq <rumpf_a@web.de>2012-07-28 17:28:36 +0200
commit58a66a0d705e824b69ee7b355dbc8c304493afdd (patch)
tree5d793dac0fb56f485d307294ea4828dc4fbf8df4 /compiler
parentb9afdffb3e36d7c54aed22cd7a3a669f2e13a97e (diff)
downloadNim-58a66a0d705e824b69ee7b355dbc8c304493afdd.tar.gz
more reliable NI/NU definitions
Diffstat (limited to 'compiler')
-rwxr-xr-xcompiler/cgen.nim17
1 files changed, 3 insertions, 14 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim
index e4286f5de..8d027b11c 100755
--- a/compiler/cgen.nim
+++ b/compiler/cgen.nim
@@ -800,20 +800,9 @@ proc genVarPrototype(m: BModule, sym: PSym) =
   if sfExportc in sym.flags and generatedHeader != nil:
     genVarPrototypeAux(generatedHeader, sym)
 
-proc addIntTypes(result: var PRope) =
-  case platform.CPU[targetCPU].intSize
-  of 16:
-    appff(result, 
-          "$ntypedef short int NI;$n" & "typedef unsigned short int NU;$n", 
-          "$n%NI = type i16$n", [])
-  of 32: 
-    appff(result, 
-          "$ntypedef long int NI;$n" & "typedef unsigned long int NU;$n", 
-          "$n%NI = type i32$n", [])
-  of 64: 
-    appff(result, "$ntypedef long long int NI;$n" &
-        "typedef unsigned long long int NU;$n", "$n%NI = type i64$n", [])
-  else: nil
+proc addIntTypes(result: var PRope) {.inline.} =
+  appf(result, "#define NIM_INTBITS $1", [
+    platform.CPU[targetCPU].intSize.toRope])
 
 proc getCopyright(cfilenoext: string): PRope = 
   if optCompileOnly in gGlobalOptions: