aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/api_gen
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2016-05-17 14:43:26 +0200
committerDan Gudmundsson <[email protected]>2016-05-17 14:43:26 +0200
commit8f213ab9fc5e87f4d54c134bd3d7017ab772b452 (patch)
tree1d8af9c7b5588dce559765f977496d13f671e170 /lib/wx/api_gen
parent0545c22c9c07c55569e067c57ec184f018a54947 (diff)
parent415a912b969c24a60c47ff7e74e560047b2d747f (diff)
downloadotp-8f213ab9fc5e87f4d54c134bd3d7017ab772b452.tar.gz
otp-8f213ab9fc5e87f4d54c134bd3d7017ab772b452.tar.bz2
otp-8f213ab9fc5e87f4d54c134bd3d7017ab772b452.zip
Merge branch 'dgud/wx/cmd-queue-bug'
* dgud/wx/cmd-queue-bug: Fix compilation warning wx: Fix generated defines in gl.hrl wx: Fix driver command queue
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("//" ++ _) -> [];