Issue 114: extern keyword
Status:  Fixed
Owner: ----
Closed:  Aug 2011
Reported by michaelbaczynski@gmail.com, Apr 1, 2011
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
I think this was related to #124 (https://code.google.com/p/hxcpp/issues/detail?id=124) so it can be closed now
Aug 11, 2011
Project Member #2 gameh...@gmail.com
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