|
@@ -926,6 +926,10 @@ let is_extern_class class_def =
|
|
|
| _ -> false );
|
|
|
;;
|
|
|
|
|
|
+let is_scalar_abstract abstract_def =
|
|
|
+ Meta.has Meta.Scalar abstract_def.a_meta && Meta.has Meta.CoreType abstract_def.a_meta
|
|
|
+;;
|
|
|
+
|
|
|
|
|
|
let real_non_native_interfaces =
|
|
|
List.filter (function (t,pl) ->
|
|
@@ -1664,7 +1668,10 @@ let rec cpp_type_of ctx haxe_type =
|
|
|
|
|
|
| TAbstract (a,params) ->
|
|
|
cpp_type_from_path ctx a.a_path params (fun () ->
|
|
|
- TCppScalar(join_class_path a.a_path "::") )
|
|
|
+ if is_scalar_abstract a then
|
|
|
+ TCppScalar(join_class_path a.a_path "::")
|
|
|
+ else
|
|
|
+ TCppDynamic)
|
|
|
|
|
|
| TType (type_def,params) ->
|
|
|
cpp_type_from_path ctx type_def.t_path params (fun () ->
|
|
@@ -3739,12 +3746,17 @@ let find_referenced_types_flags ctx obj super_deps constructor_deps header_only
|
|
|
and add_type in_path =
|
|
|
add_type_flag false in_path
|
|
|
in
|
|
|
- let add_extern_class klass =
|
|
|
- let include_file = get_meta_string_path klass.cl_meta (if for_depends then Meta.Depend else Meta.Include) in
|
|
|
+ let add_extern_type decl =
|
|
|
+ let tinfo = t_infos decl in
|
|
|
+ let include_file = get_meta_string_path tinfo.mt_meta (if for_depends then Meta.Depend else Meta.Include) in
|
|
|
if (include_file<>"") then
|
|
|
add_type ( path_of_string include_file )
|
|
|
- else if (not for_depends) && (has_meta_key klass.cl_meta Meta.Include) then
|
|
|
- add_type klass.cl_path
|
|
|
+ else if (not for_depends) && (has_meta_key tinfo.mt_meta Meta.Include) then
|
|
|
+ add_type tinfo.mt_path
|
|
|
+ in
|
|
|
+
|
|
|
+ let add_extern_class klass =
|
|
|
+ add_extern_type (TClassDecl klass)
|
|
|
in
|
|
|
let add_native_gen_class klass =
|
|
|
let include_file = get_meta_string_path klass.cl_meta (if for_depends then Meta.Depend else Meta.Include) in
|
|
@@ -3780,6 +3792,8 @@ let find_referenced_types_flags ctx obj super_deps constructor_deps header_only
|
|
|
| _ when is_extern_class klass -> add_extern_class klass
|
|
|
| _ -> (match klass.cl_kind with KTypeParameter _ -> () | _ -> add_type klass.cl_path);
|
|
|
)
|
|
|
+ | TAbstract (a,params) when is_scalar_abstract a ->
|
|
|
+ add_extern_type (TAbstractDecl a)
|
|
|
| TFun (args,haxe_type) -> visit_type haxe_type;
|
|
|
List.iter (fun (_,_,t) -> visit_type t; ) args;
|
|
|
| _ -> ()
|