summaryrefslogtreecommitdiff
path: root/cffi/commontypes.py
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2015-11-03 08:47:25 +0100
committerArmin Rigo <arigo@tunes.org>2015-11-03 08:47:25 +0100
commit675ed8c38a17b4a22e2b76906377675711ee47b5 (patch)
tree0610662e5535f5e218d6a0afb8b7c38b82348213 /cffi/commontypes.py
parent8249cb6f4e628cce17b509cc24ece6425b83497a (diff)
downloadcffi-675ed8c38a17b4a22e2b76906377675711ee47b5.tar.gz
Issue #228: do the same for "FILE". Only remaining case now is the
very obscure Windows type UNICODE_STRING. I think it is unlikely that someone hits the case of their cdef not mentioning UNICODE_STRING but their runtime code still wants to use it, so I'll close this issue.
Diffstat (limited to 'cffi/commontypes.py')
-rw-r--r--cffi/commontypes.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/cffi/commontypes.py b/cffi/commontypes.py
index 60f2532..3d11aae 100644
--- a/cffi/commontypes.py
+++ b/cffi/commontypes.py
@@ -2,10 +2,7 @@ import sys
from . import api, model
-COMMON_TYPES = {
- 'FILE': model.unknown_type('FILE', '_IO_FILE'),
- 'bool': '_Bool',
- }
+COMMON_TYPES = {}
try:
# fetch "bool" and all simple Windows types
@@ -14,6 +11,9 @@ try:
except ImportError:
pass
+COMMON_TYPES['FILE'] = model.unknown_type('FILE', '_IO_FILE')
+COMMON_TYPES['bool'] = '_Bool' # in case we got ImportError above
+
for _type in model.PrimitiveType.ALL_PRIMITIVE_TYPES:
if _type.endswith('_t'):
COMMON_TYPES[_type] = _type