Browse Source

fixes for air 3.6 sdk + --gen-hx-classes

Nicolas Cannasse 12 years ago
parent
commit
dfe51d6fb4
2 changed files with 3 additions and 1 deletions
  1. 2 0
      genswf.ml
  2. 1 1
      typeload.ml

+ 2 - 0
genswf.ml

@@ -132,6 +132,7 @@ let build_class com c file =
 	let flags = if c.hlc_interface then HInterface :: flags else flags in
 	let flags = (match c.hlc_super with
 		| None | Some (HMPath ([],"Object")) -> flags
+		| Some (HMPath ([],"Function")) -> flags (* found in AIR SDK *)
 		| Some s -> HExtends (make_tpath s) :: flags
 	) in
 	let flags = List.map (fun i ->
@@ -287,6 +288,7 @@ let build_class com c file =
 			| None, Some t -> false, true, t
 			| Some t1, Some t2 -> true, true, (if t1 <> t2 then None else t1)
 		) in
+		let t = if name = "endian" then Some (HMPath (["flash";"utils"],"Endian")) else t in
 		let flags = [APublic] in
 		let flags = if stat then AStatic :: flags else flags in
 		{

+ 1 - 1
typeload.ml

@@ -880,7 +880,7 @@ let set_heritance ctx c herits p =
 			| TInst ({ cl_path = [],"Array" },_)
 			| TInst ({ cl_path = [],"String" },_)
 			| TInst ({ cl_path = [],"Date" },_)
-			| TInst ({ cl_path = [],"Xml" },_) when ((not (platform ctx.com Cpp)) && (match c.cl_path with "mt" :: _ , _ -> false | _ -> true)) ->
+			| TInst ({ cl_path = [],"Xml" },_) when ((not (platform ctx.com Cpp)) && (match c.cl_path with ("mt" | "flash") :: _ , _ -> false | _ -> true)) ->
 				error "Cannot extend basic class" p;
 			| TInst (csup,params) ->
 				csup.cl_build();