소스 검색

[cpp] Add STACK_THIS to constructor (thanks zobo)

Hugh 11 년 전
부모
커밋
89c6e4aede
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      gencpp.ml

+ 2 - 1
gencpp.ml

@@ -3031,7 +3031,8 @@ let generate_class_files common_ctx member_types super_deps constructor_deps cla
                   if has_meta_key definition.cf_meta Meta.NoDebug then ctx.ctx_debug_level <- 0;
                   if has_meta_key definition.cf_meta Meta.NoDebug then ctx.ctx_debug_level <- 0;
                   if ctx.ctx_debug_level >0 then begin
                   if ctx.ctx_debug_level >0 then begin
                      hx_stack_push ctx output_cpp dot_name "new" function_def.tf_expr.epos;
                      hx_stack_push ctx output_cpp dot_name "new" function_def.tf_expr.epos;
-                     List.iter (fun (a,(t,o)) -> output_cpp ("\nHX_STACK_ARG(" ^ (keyword_remap o) ^ ",\"" ^ a ^"\")\n") ) constructor_arg_var_list;
+                     output_cpp "HX_STACK_THIS(this)\n";
+                     List.iter (fun (a,(t,o)) -> output_cpp ("HX_STACK_ARG(" ^ (keyword_remap o) ^ ",\"" ^ a ^"\")\n") ) constructor_arg_var_list;
                   end;
                   end;
 
 
                   if (has_default_values function_def.tf_args) then begin
                   if (has_default_values function_def.tf_args) then begin