Browse Source

[cpp] Make all member functions virtual when scriptable. Closes https://github.com/HaxeFoundation/hxcpp/issues/423

Hugh 9 years ago
parent
commit
15fff45555
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/generators/gencpp.ml

+ 2 - 1
src/generators/gencpp.ml

@@ -3640,7 +3640,8 @@ let gen_member_def ctx class_def is_static is_interface field =
          end else begin
          end else begin
             let return_type = (ctx_type_string ctx function_def.tf_type) in
             let return_type = (ctx_type_string ctx function_def.tf_type) in
             if ( not is_static && not nonVirtual ) then begin
             if ( not is_static && not nonVirtual ) then begin
-               if (not (is_internal_member field.cf_name) ) then begin
+               let scriptable = Common.defined ctx.ctx_common Define.Scriptable in
+               if (not (is_internal_member field.cf_name) && not scriptable ) then begin
                   let key = (join_class_path class_def.cl_path ".") ^ "." ^ field.cf_name in
                   let key = (join_class_path class_def.cl_path ".") ^ "." ^ field.cf_name in
                   try output (Hashtbl.find ctx.ctx_class_member_types key) with Not_found -> ()
                   try output (Hashtbl.find ctx.ctx_class_member_types key) with Not_found -> ()
                end else
                end else