| Issue 114: | extern keyword | |
| 1 person starred this issue and may be notified of changes. | Back to list |
from: http://haxe.1354130.n2.nabble.com/feature-request-assert-keyword-td5859429.html -----file Assert.hx #if (!debug) extern #end class Assert { #if debug inline public static function assert(condition:Bool, info:String, ?posInfos:haxe.PosInfos):Void { if (!(condition)) throw new AssertionError(info, posInfos); } #else inline public static function assert(condition:Bool, info:String, ?posInfos:haxe.PosInfos):Void {} #end } -----file Main.hx class Main { static function main() { Assert.assert(false, "error"); } } compilation fails with: ./Assert.cpp(80) : fatal error C1083: Cannot open include file: 'extern/Assert.cpp': No such file or directory my current workaround is: #if (!debug && !cpp) extern #end but in this case Assert calls are substituted with calls to Dynamic()
Jul 29, 2011
#1
michaelbaczynski@gmail.com
Aug 11, 2011
Hi, Ok, I'll close this now. I'm not sure what exactly "extern" is supposed to mean. In cpp, extern means "this is implemented externally (in in extern/Asset.cpp)" - so best to skip the "extern" definition for this target.
Status:
Fixed
|