2
0
Эх сурвалжийг харах

Add @:keep to the cpp Std members to avoid DCE creating significant dependency changes when unrelated code uses one of the lesser functions, such as random

hughsando 11 жил өмнө
parent
commit
9f284a45a2
2 өөрчлөгдсөн 8 нэмэгдсэн , 8 устгасан
  1. 1 1
      libs
  2. 7 7
      std/cpp/_std/Std.hx

+ 1 - 1
libs

@@ -1 +1 @@
-Subproject commit faf3761e1e1627c63b4b53d8044df915d77ce27d
+Subproject commit 87a41172b0afb34df37adfee2c07c1b561e4de63

+ 7 - 7
std/cpp/_std/Std.hx

@@ -20,31 +20,31 @@
  * DEALINGS IN THE SOFTWARE.
  * DEALINGS IN THE SOFTWARE.
  */
  */
 @:coreApi class Std {
 @:coreApi class Std {
-	public static function is( v : Dynamic, t : Dynamic ) : Bool {
+	@:keep public static function is( v : Dynamic, t : Dynamic ) : Bool {
 		return untyped __global__.__instanceof(v,t);
 		return untyped __global__.__instanceof(v,t);
 	}
 	}
 
 
-	public static function instance<T>( v : { }, c : Class<T> ) : T {
+	@:keep public static function instance<T>( v : { }, c : Class<T> ) : T {
 		return Std.is(v, c) ? cast v : null;
 		return Std.is(v, c) ? cast v : null;
 	}
 	}
 
 
-	public static function string( s : Dynamic ) : String {
+	@:keep public static function string( s : Dynamic ) : String {
 		return untyped s==null ? "null" : s.toString();
 		return untyped s==null ? "null" : s.toString();
 	}
 	}
 
 
-	public static function int( x : Float ) : Int {
+	@:keep public static function int( x : Float ) : Int {
 		return untyped __global__.__int__(x);
 		return untyped __global__.__int__(x);
 	}
 	}
 
 
-	public static function parseInt( x : String ) : Null<Int> {
+	@:keep public static function parseInt( x : String ) : Null<Int> {
 		return untyped __global__.__hxcpp_parse_int(x);
 		return untyped __global__.__hxcpp_parse_int(x);
 	}
 	}
 
 
-	public static function parseFloat( x : String ) : Float {
+	@:keep public static function parseFloat( x : String ) : Float {
 		return untyped __global__.__hxcpp_parse_float(x);
 		return untyped __global__.__hxcpp_parse_float(x);
 	}
 	}
 
 
-	public static function random( x : Int ) : Int {
+	@:keep public static function random( x : Int ) : Int {
 		if (x <= 0) return 0;
 		if (x <= 0) return 0;
 		return untyped __global__.__hxcpp_irand(x);
 		return untyped __global__.__hxcpp_irand(x);
 	}
 	}