HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.03k stars 648 forks source link

Bug during haxe --macro Field index for SSL_IS_SERVER not found #11631

Closed yuxiaomao closed 2 months ago

yuxiaomao commented 2 months ago

Run the following code with haxe --macro Config.main() result in error Field index for SSL_IS_SERVER not found on prototype mbedtls._SslEndpoint.SslEndpoint_Impl_ Since https://github.com/HaxeFoundation/haxe/commit/944d4fdba9cce40d0e00c3a2495d0180e6e1f3c5 ( https://github.com/HaxeFoundation/haxe/issues/11481 )

It works fine with haxe --run Config.

class Config {
    public static function main() {
        Sys.println("Config...");
    }

    public static function updateHaxeLinux() {
        new haxe.Http("https://build.haxe.org/builds/haxe/linux64/");
    }
}
kLabz commented 2 months ago

Note that it's because of https://github.com/HaxeFoundation/haxe/blob/76b36356b2f79de32731d6cfbcec58f85cd80562/std/eval/_std/mbedtls/SslEndpoint.hx#L3-L7

Which seems to indicate we do need some "@:native" behavior for macro (but probably only for std things)