[pypy-svn] r69854 - pypy/trunk/pypy/module/oracle
afa at codespeak.net
afa at codespeak.net
Wed Dec 2 18:08:25 CET 2009
Author: afa
Date: Wed Dec 2 18:08:25 2009
New Revision: 69854
Modified:
pypy/trunk/pypy/module/oracle/roci.py
Log:
Dance around the oci.h header which "#define boolean int"
that broke other files which whant to use "boolean" as an identifier.
Modified: pypy/trunk/pypy/module/oracle/roci.py
==============================================================================
--- pypy/trunk/pypy/module/oracle/roci.py (original)
+++ pypy/trunk/pypy/module/oracle/roci.py Wed Dec 2 18:08:25 2009
@@ -14,19 +14,27 @@
"Please set ORACLE_HOME to the root of an Oracle client installation")
if sys.platform == 'win32':
- eci = ExternalCompilationInfo(
- includes = ['oci.h'],
- include_dirs = [str(ORACLE_HOME.join('OCI', 'include'))],
- libraries = ['oci'],
- library_dirs = [str(ORACLE_HOME.join('OCI', 'lib', 'MSVC'))],
- )
+ include_dirs = [str(ORACLE_HOME.join('OCI', 'include'))]
+ libraries = ['oci']
+ library_dirs = [str(ORACLE_HOME.join('OCI', 'lib', 'MSVC'))]
else:
- eci = ExternalCompilationInfo(
- includes = ['oci.h'],
- include_dirs = [str(ORACLE_HOME.join('sdk', 'include'))],
- libraries = ['clntsh'],
- library_dirs = [str(ORACLE_HOME.join('lib'))],
- )
+ include_dirs = [str(ORACLE_HOME.join('sdk', 'include'))]
+ libraries = ['clntsh']
+ library_dirs = [str(ORACLE_HOME.join('lib'))]
+
+eci = ExternalCompilationInfo(
+ post_include_bits = [
+ # One single string, to be sure it will
+ # be rendered in this order
+ '#include <oci.h>\n' +
+ 'typedef boolean oci_boolean;\n' +
+ '#undef boolean'
+ ],
+ include_dirs = include_dirs,
+ libraries = libraries,
+ library_dirs = library_dirs,
+ )
+
class CConfig:
_compilation_info_ = eci
@@ -39,7 +47,7 @@
sb4 = platform.SimpleType('sb4', rffi.INT)
sword = platform.SimpleType('sword', rffi.INT)
uword = platform.SimpleType('uword', rffi.UINT)
- boolean = platform.SimpleType('boolean', rffi.UINT)
+ boolean = platform.SimpleType('oci_boolean', rffi.UINT)
OCIDuration = platform.SimpleType('OCIDuration', rffi.UINT)
OCIInd = platform.SimpleType('OCIInd', rffi.INT)
OCIPinOpt = platform.SimpleType('OCIPinOpt', rffi.INT)
More information about the Pypy-commit
mailing list