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_cpp.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_cpp.erl')
-rw-r--r-- | lib/wx/api_gen/wx_gen_cpp.erl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/wx/api_gen/wx_gen_cpp.erl b/lib/wx/api_gen/wx_gen_cpp.erl index 04d3f9264c..7027ac305d 100644 --- a/lib/wx/api_gen/wx_gen_cpp.erl +++ b/lib/wx/api_gen/wx_gen_cpp.erl @@ -170,6 +170,14 @@ gen_funcs(Defs) -> w("#include \"wxe_macros.h\"~n"), w("#include \"wxe_derived_dest.h\"~n~n"), + w("#if !wxCHECK_VERSION(2,9,0)~n", []), + [w("#define ~p int~n", [Enum]) || + Enum <- [wxPenJoin, wxPenCap, wxImageResizeQuality, %%wxBitmapType, + wxPolygonFillMode, wxMappingMode, wxRasterOperationMode, + wxFloodFillStyle + ]], + w("#endif~n",[]), + w("void WxeApp::wxe_dispatch(wxeCommand& Ecmd)~n{~n"), w(" char * bp = Ecmd.buffer;~n"), w(" wxeMemEnv *memenv = getMemEnv(Ecmd.port);~n"), @@ -812,12 +820,12 @@ call_arg(#param{where=c, alt={size,Id}}) when is_integer(Id) -> call_arg(#param{name=N,def=Def,type=#type{name=Type,by_val=true,single=true,base=Base}}) when Base =:= int; Base =:= long; Base =:= float; Base =:= double; Base =:= bool -> case Def of - none -> "(" ++ to_string(Type) ++ ") *" ++ N; + none -> "(" ++ to_string(Type) ++ ") *" ++ N; %% Remove _ -> N end; call_arg(#param{name=N,type=#type{base={enum,Type}, by_val=true,single=true}}) -> - "(" ++ enum_type(Type) ++") " ++ N; + "(" ++ enum_type(Type) ++") " ++ N; %% Remove call_arg(#param{name=N,type=#type{base={class,_},by_val=true,single=true}}) -> "*" ++ N; call_arg(#param{name=N,type=#type{base={class,_},ref=reference,single=true}}) -> "*" ++ N; call_arg(#param{name=N,type=#type{base=eventType}}) -> |