aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/api_gen
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2016-05-12 09:31:53 +0200
committerDan Gudmundsson <[email protected]>2016-05-12 09:31:53 +0200
commitf8e2668ef2ea42fbbf695d63cb840913c32f1d72 (patch)
tree532c4beb9ad32c48771c8977f32f0e6cbda45f10 /lib/wx/api_gen
parent5c3d447c95d55c9c7da2dd69569549992e3fd741 (diff)
downloadotp-f8e2668ef2ea42fbbf695d63cb840913c32f1d72.tar.gz
otp-f8e2668ef2ea42fbbf695d63cb840913c32f1d72.tar.bz2
otp-f8e2668ef2ea42fbbf695d63cb840913c32f1d72.zip
wx: Fix generated defines in gl.hrl
Diffstat (limited to 'lib/wx/api_gen')
-rw-r--r--lib/wx/api_gen/gl_gen.erl14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/wx/api_gen/gl_gen.erl b/lib/wx/api_gen/gl_gen.erl
index 0473b7d771..54635bdd2e 100644
--- a/lib/wx/api_gen/gl_gen.erl
+++ b/lib/wx/api_gen/gl_gen.erl
@@ -191,8 +191,9 @@ parse_define([#xmlElement{name=initializer,content=Contents}|_R],Def,_Os) ->
try
case Val0 of
"0x" ++ Val1 ->
- _ = list_to_integer(Val1, 16),
- Def#def{val=Val1, type=hex};
+ Val2 = strip_type_cast(Val1),
+ _ = list_to_integer(Val2, 16),
+ Def#def{val=Val2, type=hex};
_ ->
Val = list_to_integer(Val0),
Def#def{val=Val, type=int}
@@ -214,6 +215,15 @@ extract_def2([#xmlElement{content=Cs}|R]) ->
extract_def2(Cs) ++ extract_def2(R);
extract_def2([]) -> [].
+strip_type_cast(Int) ->
+ lists:reverse(strip_type_cast2(lists:reverse(Int))).
+
+strip_type_cast2("u"++Rest) -> Rest; %% unsigned
+strip_type_cast2("lu"++Rest) -> Rest; %% unsigned long
+strip_type_cast2("llu"++Rest) -> Rest; %% unsigned long long
+strip_type_cast2(Rest) -> Rest.
+
+
strip_comment("/*" ++ Rest) ->
strip_comment_until_end(Rest);
strip_comment("//" ++ _) -> [];