aboutsummaryrefslogtreecommitdiff
path: root/emscripten.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-10-02 17:44:32 +0200
committerAlon Zakai <alonzakai@gmail.com>2011-10-02 17:44:32 +0200
commitfea282c5d45daf83170bff821aa0b3be7abd3499 (patch)
treed6031150cba28b1802498bdf3da741f8845d1ff3 /emscripten.py
parent1b17d7ef860b127d3a2bd6862f1684990d510d2c (diff)
fix langinfo
Diffstat (limited to 'emscripten.py')
-rwxr-xr-xemscripten.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/emscripten.py b/emscripten.py
index 8a1fb03e..32be4450 100755
--- a/emscripten.py
+++ b/emscripten.py
@@ -178,8 +178,14 @@ def main(args):
for line in open(header, 'r'):
line = line.replace('\t', ' ')
m = re.match('^ *# *define +(?P<name>[-\w_.]+) +\(?(?P<value>[-\w_.|]+)\)?.*', line)
+ if not m:
+ # Catch enum defines of a very limited sort
+ m = re.match('^ +(?P<name>[A-Z_\d]+) += +(?P<value>\d+).*', line)
if m:
- defines[m.group('name')] = m.group('value')
+ if m.group('name') != m.group('value'):
+ defines[m.group('name')] = m.group('value')
+ #else:
+ # print 'Warning: %s #defined to itself' % m.group('name') # XXX this can happen if we are set to be equal to an enum (with the same name)
m = re.match('^ *# *include *["<](?P<name>[\w_.-/]+)[">].*', line)
if m:
# Find this file