aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/api_gen/gl_gen.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/wx/api_gen/gl_gen.erl')
-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("//" ++ _) -> [];