Closed aliokan closed 5 years ago
The errors you are getting with Haxe 4.x are unrelated to webidl : some of your macro are adding twice the AInline accessor to some generated code which makes Haxe compiler complain about it as if you would have declared inline inline function foo() {}
. Please fix your macro generation, I was able to correctly generate C++ code using Haxe 4.0 and latest webidl git.
Actually, it not my code, I try to compile the sample
folder. ^^
I can't reproduce when compiling the sample. Which command are you using exactly? Are you using WebIDL git version?
I use git version of WebIDL, nightly build of haxe, and emscripten 1.38.21
git clone https://github.com/ncannasse/webidl.git
cd webidl/sample/
# set EMSCRIPTEN path
source /Users/user/Documents/GIT-REPOS/emsdk/emsdk_env.sh
make js
I get that result
haxe -lib webidl --macro "SampleModule.buildLibCpp()"
haxe -lib webidl --macro "SampleModule.buildLibJS()"
> python /Users/user/Documents/GIT-REPOS/emsdk/emscripten/1.38.21/emcc.py -O2 -c point.cpp -o point.bc
> python /Users/user/Documents/GIT-REPOS/emsdk/emscripten/1.38.21/emcc.py -O2 -c libpoint.cpp -o libpoint.bc
> make -f Makefile.tmp
python "/Users/user/Documents/GIT-REPOS/emsdk/emscripten/1.38.21/emcc.py" point.bc libpoint.bc -O2 -s EXPORT_NAME="'libpoint'" --memory-init-file 0 -o libpoint.js
haxe -js sample.js -lib webidl -main Sample -dce full
/Users/user/haxe/versions/80f42bd/std/haxe/macro/Expr.hx:826: characters 2-10 : Duplicate access modifier inline
SampleModule.hx:2: characters 26-70 : Defined in this class
/Users/user/haxe/versions/80f42bd/std/haxe/macro/Expr.hx:826: characters 2-10 : Previously defined here
SampleModule.hx:2: characters 26-70 : Defined in this class
/Users/user/haxe/versions/80f42bd/std/haxe/macro/Expr.hx:826: characters 2-10 : Duplicate access modifier inline
SampleModule.hx:2: characters 26-70 : Defined in this class
/Users/user/haxe/versions/80f42bd/std/haxe/macro/Expr.hx:826: characters 2-10 : Previously defined here
SampleModule.hx:2: characters 26-70 : Defined in this class
/Users/user/haxe/versions/80f42bd/std/haxe/macro/Expr.hx:826: characters 2-10 : Duplicate access modifier inline
SampleModule.hx:2: characters 26-70 : Defined in this class
/Users/user/haxe/versions/80f42bd/std/haxe/macro/Expr.hx:826: characters 2-10 : Previously defined here
SampleModule.hx:2: characters 26-70 : Defined in this class
/Users/user/haxe/versions/80f42bd/std/haxe/macro/Expr.hx:826: characters 2-10 : Duplicate access modifier inline
SampleModule.hx:2: characters 26-70 : Defined in this class
/Users/user/haxe/versions/80f42bd/std/haxe/macro/Expr.hx:826: characters 2-10 : Previously defined here
SampleModule.hx:2: characters 26-70 : Defined in this class
/Users/user/haxe/versions/80f42bd/std/haxe/macro/Expr.hx:826: characters 2-10 : Duplicate access modifier inline
SampleModule.hx:2: characters 26-70 : Defined in this class
/Users/user/haxe/versions/80f42bd/std/haxe/macro/Expr.hx:826: characters 2-10 : Previously defined here
SampleModule.hx:2: characters 26-70 : Defined in this class
make: *** [js] Error 1
I've been doing a lot of testing ( not organized, more like sporadic testing in different situations ) and I run into this issue in random different situations. Replacing the following line with if (f.access.indexOf(AInline) == -1) f.access.push(AInline);
fixes it for me.
https://github.com/ncannasse/webidl/blob/master/webidl/Module.hx#L298
I'm on Ubuntu 16.04 so I don't think it has anything to do with being on a mac.
@zicklag could you make a PR?
@ncannasse Sure thing.
New year, new try :) but I still facing errors :/
With Haxe nightly build
Haxe 3.4.7