[PATCH 7/7] On win32 add __intX types explicitly

10 views
Skip to first unread message

Lars Munch

unread,
Jan 2, 2014, 4:47:31 PM1/2/14
to ctyp...@googlegroups.com, Lars Munch
On win32 (mingw headers) add __intX types explicitly to avoid syntax error.
---
ctypesgencore/parser/preprocessor.py | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/ctypesgencore/parser/preprocessor.py b/ctypesgencore/parser/preprocessor.py
index afe24a4..217fc0c 100644
--- a/ctypesgencore/parser/preprocessor.py
+++ b/ctypesgencore/parser/preprocessor.py
@@ -107,6 +107,13 @@ class PreprocessorParser(object):
"__const=const", "__asm__(x)=",
"__asm(x)=", "CTYPESGEN=1"]

+ # On win32 (mingw headers) add __intX types explicitly
+ if sys.platform == 'win32':
+ self.defines += ["__int8=char",
+ "__int16=short"
+ "__int32=int",
+ "__int64=long long" ]
+
# On OSX, explicitly add these defines to keep from getting syntax
# errors in the OSX standard headers.
if sys.platform == 'darwin':
--
1.8.5.2

Reply all
Reply to author
Forward
0 new messages