[pypy-svn] r35511 - in pypy/dist/pypy/translator/c: . src

arigo at codespeak.net arigo at codespeak.net
Sat Dec 9 00:28:22 CET 2006


Author: arigo
Date: Sat Dec  9 00:28:20 2006
New Revision: 35511

Modified:
   pypy/dist/pypy/translator/c/primitive.py
   pypy/dist/pypy/translator/c/src/g_prerequisite.h
Log:
(pedronis, arigo)

Try to use _Bool with gcc.


Modified: pypy/dist/pypy/translator/c/primitive.py
==============================================================================
--- pypy/dist/pypy/translator/c/primitive.py	(original)
+++ pypy/dist/pypy/translator/c/primitive.py	Sat Dec  9 00:28:20 2006
@@ -151,7 +151,7 @@
     Float:    'double @',
     Char:     'char @',
     UniChar:  'unsigned int @',
-    Bool:     'char @',
+    Bool:     'bool_t @',
     Void:     'void @',
     Address:  'void* @',
     WeakGcAddress:  'GC_hidden_pointer @',
@@ -165,7 +165,7 @@
     Float:    '-1.0',
     Char:     '((char) -1)',
     UniChar:  '((unsigned) -1)',
-    Bool:     '((char) -1)',
+    Bool:     '0 /* error */',
     Void:     '/* error */',
     Address:  'NULL',
     WeakGcAddress:  'HIDE_POINTER(NULL)',

Modified: pypy/dist/pypy/translator/c/src/g_prerequisite.h
==============================================================================
--- pypy/dist/pypy/translator/c/src/g_prerequisite.h	(original)
+++ pypy/dist/pypy/translator/c/src/g_prerequisite.h	Sat Dec  9 00:28:20 2006
@@ -15,3 +15,10 @@
 #endif
 
 #include <stddef.h>
+
+
+#ifdef __GNUC__       /* other platforms too, probably */
+typedef _Bool bool_t;
+#else
+typedef unsigned char bool_t;
+#endif



More information about the Pypy-commit mailing list