compiler/ecc: Never including stdint.h anymore, always defining uintptr_t/intptr_t...
authorJerome St-Louis <jerome@ecere.com>
Sat, 23 Feb 2013 00:21:54 +0000 (19:21 -0500)
committerJerome St-Louis <jerome@ecere.com>
Sat, 23 Feb 2013 00:21:54 +0000 (19:21 -0500)
compiler/bootstrap/ecc/bootstrap/ecc.c
compiler/bootstrap/ecc/bootstrap/ecc.main.c
compiler/ecc/ecc.ec

index 51ae1a2..6b37b6a 100644 (file)
@@ -27,17 +27,13 @@ typedef unsigned __int64 uint64;
 #else
 #define __ENDIAN_PAD(x) 0
 #endif
-#ifdef __MINGW32__
-#ifdef _WIN64
+#if defined(_WIN64) || WORDSIZE == 64
 typedef unsigned long long int uintptr_t;
 typedef long long int intptr_t;
 #else
 typedef unsigned int uintptr_t;
 typedef int intptr_t;
 #endif
-#else
-#include <stdint.h>
-#endif
 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
 
 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
@@ -1176,17 +1172,13 @@ __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#define __ENDIA
 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#else\n");
 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#define __ENDIAN_PAD(x) 0\n");
 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#endif\n");
-__ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#ifdef __MINGW32__\n");
-__ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#ifdef _WIN64\n");
+__ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#if defined(_WIN64) || WORDSIZE == 64\n");
 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "typedef unsigned long long int uintptr_t;\n");
 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "typedef long long int intptr_t;\n");
 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#else\n");
 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "typedef unsigned int uintptr_t;\n");
 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "typedef int intptr_t;\n");
 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#endif\n");
-__ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#else\n");
-__ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#include <stdint.h>\n");
-__ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#endif\n");
 if(ast)
 OutputTree(ast, output);
 (__ecereNameSpace__ecere__com__eInstance_DecRef(output), output = 0);
index 3386fb8..04d8be9 100644 (file)
@@ -27,17 +27,13 @@ typedef unsigned __int64 uint64;
 #else
 #define __ENDIAN_PAD(x) 0
 #endif
-#ifdef __MINGW32__
-#ifdef _WIN64
+#if defined(_WIN64) || WORDSIZE == 64
 typedef unsigned long long int uintptr_t;
 typedef long long int intptr_t;
 #else
 typedef unsigned int uintptr_t;
 typedef int intptr_t;
 #endif
-#else
-#include <stdint.h>
-#endif
 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
 
 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
index 08bbb69..9aa3de6 100644 (file)
@@ -520,17 +520,18 @@ class CompilerApp : Application
                      output.Printf("#else\n");
                         output.Printf("#define __ENDIAN_PAD(x) 0\n");
                      output.Printf("#endif\n");
-                     output.Printf("#ifdef __MINGW32__\n");
-                     output.Printf("#ifdef _WIN64\n");
+                     //output.Printf("#ifdef __MINGW32__\n");
+                     //output.Printf("#ifdef _WIN64\n");
+                     output.Printf("#if defined(_WIN64) || WORDSIZE == 64\n");
                      output.Printf("typedef unsigned long long int uintptr_t;\n");
                      output.Printf("typedef long long int intptr_t;\n");
                      output.Printf("#else\n");
                      output.Printf("typedef unsigned int uintptr_t;\n");
                      output.Printf("typedef int intptr_t;\n");
                      output.Printf("#endif\n");
-                     output.Printf("#else\n");
-                     output.Printf("#include <stdint.h>\n");
-                     output.Printf("#endif\n");
+                     //output.Printf("#else\n");
+                     //output.Printf("#include <stdint.h>\n");
+                     //output.Printf("#endif\n");
 
                      // NOTE: If anything is changed up there, the start outputLine must be updated in libec's output.c or Debugging lines will be wrong