Browse Source

[cpp] export global functions as special case

hughsando 11 năm trước cách đây
mục cha
commit
9736df3cfd
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      gencpp.ml

+ 2 - 0
gencpp.ml

@@ -4616,6 +4616,8 @@ class script_writer common_ctx ctx filename =
          | _ -> false;
       in
       (match (remove_parens func).eexpr with
+      | TField ( { eexpr = TLocal  { v_name = "__global__" }}, field ) ->
+               this#write ("CALLGLOBAL " ^ (this#stringText (field_name field)) ^ argN ^ "\n");
       | TField (obj,FStatic (class_def,field) ) when is_real_function field ->
                this#write ("CALLSTATIC " ^ (this#instText class_def) ^ " " ^ (this#stringText field.cf_name) ^
                   argN ^ "\n");