summaryrefslogtreecommitdiff
path: root/cffi/model.py
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2015-11-02 21:27:27 +0100
committerArmin Rigo <arigo@tunes.org>2015-11-02 21:27:27 +0100
commitb1847f50a09cbdea1dc923eace347e6c9cf84791 (patch)
tree66428bf12390ee63db23669ea7c22d1b9f77e620 /cffi/model.py
parent20620bc23047ac7881c6bc1405d09372e2a2a694 (diff)
downloadcffi-b1847f50a09cbdea1dc923eace347e6c9cf84791.tar.gz
Propagate "volatile" in addition to "const" and "restrict"
Diffstat (limited to 'cffi/model.py')
-rw-r--r--cffi/model.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/cffi/model.py b/cffi/model.py
index b9da706..067e89c 100644
--- a/cffi/model.py
+++ b/cffi/model.py
@@ -7,10 +7,13 @@ from .lock import allocate_lock
# type qualifiers
Q_CONST = 0x01
Q_RESTRICT = 0x02
+Q_VOLATILE = 0x04
def qualify(quals, replace_with):
if quals & Q_CONST:
replace_with = ' const ' + replace_with.lstrip()
+ if quals & Q_VOLATILE:
+ replace_with = ' volatile ' + replace_with.lstrip()
if quals & Q_RESTRICT:
# It seems that __restrict is supported by gcc and msvc.
# If you hit some different compiler, add a #define in