aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/api_gen/wx_gen_cpp.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2012-12-13 10:54:12 +0100
committerDan Gudmundsson <[email protected]>2013-01-09 11:44:27 +0100
commitc8b4d62cf92b3e0662adfb9e6a5d80d516413cde (patch)
tree0d244c8f2fdf2230e434b8140d2fa6cdb0b7d286 /lib/wx/api_gen/wx_gen_cpp.erl
parent7771a19fa7e65b866a5c6a922adc636c1ec45a51 (diff)
downloadotp-c8b4d62cf92b3e0662adfb9e6a5d80d516413cde.tar.gz
otp-c8b4d62cf92b3e0662adfb9e6a5d80d516413cde.tar.bz2
otp-c8b4d62cf92b3e0662adfb9e6a5d80d516413cde.zip
wx: Fix changed getfunctions
wx-2.9 have changed some functions from returning references to objects to returning objects instead
Diffstat (limited to 'lib/wx/api_gen/wx_gen_cpp.erl')
-rw-r--r--lib/wx/api_gen/wx_gen_cpp.erl13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/wx/api_gen/wx_gen_cpp.erl b/lib/wx/api_gen/wx_gen_cpp.erl
index 7027ac305d..08f8068555 100644
--- a/lib/wx/api_gen/wx_gen_cpp.erl
+++ b/lib/wx/api_gen/wx_gen_cpp.erl
@@ -769,7 +769,7 @@ return_res1(#type{name=Type,ref={pointer,_}, base={term,_}}) ->
{Type ++ " * Result = (" ++ Type ++ "*)", ""};
return_res1(#type{name=Type,ref={pointer,_}}) ->
{Type ++ " * Result = (" ++ Type ++ "*)", ""};
-return_res1(#type{name=Type,single=true,ref=reference}) ->
+return_res1(#type{name=Type,single=true,by_val=false,ref=reference}) ->
{Type ++ " * Result = &", ""};
return_res1(#type{name=Type,single=true,by_val=true})
when is_atom(Type) ->
@@ -792,8 +792,13 @@ return_res1(#type{name=Type,single=true,by_val=true, base={class, _}}) ->
io:format("~s::~s Building return value of temp ~s~n",
[get(current_class),get(current_func),Type])
end,
- %% #class{id=Id} = get({class,Type}),
- {Type ++ " * Result = new " ++ Type ++ "(", "); newPtr((void *) Result,"
+ %% ClassDef = get({class,Type}),
+ %% Class = case is_derived(ClassDef) of
+ %% true -> "E" ++ Type;
+ %% false -> Type
+ %% end,
+ Class = Type, %% Remove
+ {Class ++ " * Result = new " ++ Class ++ "(", "); newPtr((void *) Result,"
++ "3, memenv);"};
return_res1(#type{base={enum,_Type},single=true,by_val=true}) ->
{"int Result = " , ""};
@@ -955,6 +960,8 @@ build_ret(Name,_,#type{base={enum,_Type},single=true}) ->
w(" rt.addInt(~s);~n",[Name]);
build_ret(Name,_,#type{base={comp,_,{record, _}},single=true}) ->
w(" rt.add(~s);~n", [Name]);
+build_ret(Name,{ret,_},#type{base={comp,_,_},single=true, by_val=true}) ->
+ w(" rt.add(~s);~n",[Name]);
build_ret(Name,{ret,_},#type{base={comp,_,_},single=true, ref=reference}) ->
w(" rt.add((*~s));~n",[Name]);
build_ret(Name,_,#type{base={comp,_,_},single=true}) ->