HaxeFoundation / hxcpp

Runtime files for c++ backend for haxe
Other
295 stars 184 forks source link

Abstract wrapping extern cannot find the extern #1099

Open singpolyma opened 5 months ago

singpolyma commented 5 months ago

Example:

@:include("rtc/rtc.hpp")
@:native("rtc::Description::Type")
extern enum abstract DescriptionType(Int) {
     var Unspec;
     var Offer;
     var Answer;
     var Pranswer;
     var Rollback;
}

abstract SdpType(DescriptionType) to DescriptionType from DescriptionType {
    public static var OFFER = DescriptionType.Offer;
    public static var PRANSWER = DescriptionType.Pranswer;
    public static var ANSWER = DescriptionType.Answer;
    public static var ROLLBACK = DescriptionType.Rollback;
}

I get error:

error: ‘rtc’ has not been declared
  127 | HXDLIN(  68)            ROLLBACK = rtc::Description::Type::Rollback;

This seems to be because a new file is generated for this class, but the includes for the extern are not brought across. I tried also adding @:headerInclude for the abstract, but it seems that is ignored.