diff options
author | Dan Gudmundsson <[email protected]> | 2012-12-13 08:54:29 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2013-01-09 11:41:41 +0100 |
commit | 204d0bdc0acaf8017372a3b93f54bb846b6be58e (patch) | |
tree | d7e83d8ee7a465a1fad978d9cfdecb15e56c223e /lib/wx/api_gen/wx_gen_erl.erl | |
parent | ad6e421879217ee76d3c7267bcd8234ec33153a1 (diff) | |
download | otp-204d0bdc0acaf8017372a3b93f54bb846b6be58e.tar.gz otp-204d0bdc0acaf8017372a3b93f54bb846b6be58e.tar.bz2 otp-204d0bdc0acaf8017372a3b93f54bb846b6be58e.zip |
wx: Fix int to enum
In 2.9 several functions takes enum's instead of int as arguments,
remove dirty -fpermissive fix and fix it correctly instead.
Diffstat (limited to 'lib/wx/api_gen/wx_gen_erl.erl')
-rw-r--r-- | lib/wx/api_gen/wx_gen_erl.erl | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/wx/api_gen/wx_gen_erl.erl b/lib/wx/api_gen/wx_gen_erl.erl index 35eba29450..a999a869e6 100644 --- a/lib/wx/api_gen/wx_gen_erl.erl +++ b/lib/wx/api_gen/wx_gen_erl.erl @@ -842,15 +842,20 @@ doc_enum(_,Ps) -> [doc_enum_type(Type,Name) || #param{name=Name, type=#type{base={enum,Type}}} <- Ps]. doc_enum_type(Type, Name) -> - {Enum0, #enum{vals=Vals}} = wx_gen:get_enum(Type), - Enum = case Enum0 of {_, E} -> E; E -> E end, - Consts = get(consts), - Format = fun({N,_What}) -> - #const{name=N} = gb_trees:get(N, Consts), - "?" ++ enum_name(N) - end, - Vs = args(Format, " | ", Vals), - {uppercase(Enum),Name, Vs}. + try + {Enum0, #enum{vals=Vals}} = wx_gen:get_enum(Type), + Enum = case Enum0 of {_, E} -> E; E -> E end, + Consts = get(consts), + Format = fun({N,_What}) -> + #const{name=N} = gb_trees:get(N, Consts), + "?" ++ enum_name(N) + end, + Vs = args(Format, " | ", Vals), + {uppercase(Enum),Name, Vs} + catch _:_ -> + io:format("Warning missing enum type ~p~n", [Type]), + {uppercase(Type),Name,"integer"} + end. doc_enum_desc([]) -> ok; doc_enum_desc([{_Enum,Name,Vs}|R]) -> |