Mercurial > projects > dwt2
diff java/src/java/lang/Boolean.d @ 21:9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 19 Mar 2009 20:38:55 +0100 |
parents | 6dd524f61e62 |
children |
line wrap: on
line diff
--- a/java/src/java/lang/Boolean.d Wed Mar 18 12:10:17 2009 +0100 +++ b/java/src/java/lang/Boolean.d Thu Mar 19 20:38:55 2009 +0100 @@ -3,6 +3,11 @@ import java.lang.util; import java.lang.System; +version(Tango){ + static import tango.text.Ascii; +} else { // Phobos + static import std.string; +} class Boolean : ValueWrapperT!(bool) { public static Boolean TRUE; public static Boolean FALSE; @@ -16,10 +21,10 @@ } alias ValueWrapperT!(bool).opEquals opEquals; - public int opEquals( int other ){ + public equals_t opEquals( int other ){ return value == ( other !is 0 ); } - public int opEquals( Object other ){ + public equals_t opEquals( Object other ){ if( auto o = cast(Boolean)other ){ return value == o.value; } @@ -38,7 +43,11 @@ return b ? TRUE : FALSE; } public static bool getBoolean(String name){ - return tango.text.Ascii.icompare(System.getProperty(name, "false"), "true" ) is 0; + version(Tango){ + return tango.text.Ascii.icompare(System.getProperty(name, "false"), "true" ) is 0; + } else { // Phobos + return std.string.icmp(System.getProperty(name, "false"), "true" ) is 0; + } } }