Open IBwWG opened 8 years ago
In my naive attempt at problem-solving here, I started wrapping anything that was complaining in #if macro
blocks. That started working until AsyncTransformer:
C:\HaxeToolkit\haxe\lib\moon-core\1,0,0\test>haxe -lib moon-core AsyncSugaredExa
mples.hx
C:\HaxeToolkit\haxe\lib\moon-core/1,0,0/src/moon/macros/async/AsyncTransformer.h
x:283: characters 38-42 : On static platforms, null can't be used as basic type
Int
C:\HaxeToolkit\haxe\lib\moon-core/1,0,0/src/moon/macros/async/AsyncTransformer.h
x:283: characters 38-42 : On static platforms, null can't be used as basic type
Int
C:\HaxeToolkit\haxe\lib\moon-core/1,0,0/src/moon/macros/async/AsyncTransformer.h
x:283: characters 38-42 : On static platforms, null can't be used as basic type
Bool
C:\HaxeToolkit\haxe\lib\moon-core/1,0,0/src/moon/macros/async/AsyncTransformer.h
x:283: characters 38-42 : On static platforms, null can't be used as basic type
Bool
C:\HaxeToolkit\haxe\lib\moon-core/1,0,0/src/moon/macros/async/AsyncTransformer.h
x:283: characters 38-42 : On static platforms, null can't be used as basic type
Int
C:\HaxeToolkit\haxe\lib\moon-core/1,0,0/src/moon/macros/async/AsyncTransformer.h
x:283: characters 38-42 : On static platforms, null can't be used as basic type
Int
C:\HaxeToolkit\haxe\lib\moon-core/1,0,0/src/moon/macros/async/AsyncTransformer.h
x:283: characters 38-42 : On static platforms, null can't be used as basic type
Bool
C:\HaxeToolkit\haxe\lib\moon-core/1,0,0/src/moon/macros/async/AsyncTransformer.h
x:283: characters 38-42 : On static platforms, null can't be used as basic type
Int
C:\HaxeToolkit\haxe\lib\moon-core/1,0,0/src/moon/macros/async/AsyncTransformer.h
x:283: characters 38-42 : On static platforms, null can't be used as basic type
Bool
C:\HaxeToolkit\haxe\lib\moon-core/1,0,0/src/moon/macros/async/AsyncTransformer.h
x:283: characters 38-42 : On static platforms, null can't be used as basic type
Float
C:\HaxeToolkit\haxe\lib\moon-core/1,0,0/src/moon/macros/async/AsyncTransformer.h
x:283: characters 38-42 : On static platforms, null can't be used as basic type
Float
C:\HaxeToolkit\haxe\lib\moon-core/1,0,0/src/moon/macros/async/AsyncTransformer.h
x:283: characters 38-42 : On static platforms, null can't be used as basic type
Float
C:\HaxeToolkit\haxe\lib\moon-core/1,0,0/src/moon/macros/async/AsyncTransformer.h
x:283: characters 38-42 : On static platforms, null can't be used as basic type
Int
C:\HaxeToolkit\haxe\lib\moon-core/1,0,0/src/moon/macros/async/AsyncTransformer.h
x:283: characters 38-42 : On static platforms, null can't be used as basic type
Int
C:\HaxeToolkit\haxe\lib\moon-core/1,0,0/src/moon/macros/async/AsyncTransformer.h
x:283: characters 38-42 : On static platforms, null can't be used as basic type
Bool
If I change the offending line to codes.push(macro var $v:Dynamic = null);
it compiles without a platform named...
But then compiling it for cpp fails:
cl.exe -Iinclude -nologo -O2 /WX- /fp:precise -DHX_WINDOWS -D_USING_V140_SDK71_
-GR -FS -Oy- -c -EHs -GS- -arch:SSE -IC:/HaxeToolkit/haxe/lib/hxcpp/3,2,205/incl
ude -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=321 -D_CRT_SECURE_NO_DEPRECATE -D_ALL
OW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -wd4996 -MT ./src/__r
esources__.cpp -FoC:/HaxeToolkit/haxe/lib/moon-core/1,0,0/test/export/obj/msvc19
xp/501f6158___resources__.obj
AsyncSugaredExamples.cpp
./src/AsyncSugaredExamples.cpp(233): error C2365: 'AsyncSugaredExamples_obj::cus
tomIterator::_Function_2_1::__run': redefinition; previous definition was 'data
member'
./src/AsyncSugaredExamples.cpp(200): note: see declaration of 'AsyncSugaredExamp
les_obj::customIterator::_Function_2_1::__run'
./src/AsyncSugaredExamples.cpp(414): error C2365: 'AsyncSugaredExamples_obj::sim
pleExample::_Function_1_1::run::_Function_3_1::__run': redefinition; previous de
finition was 'data member'
./src/AsyncSugaredExamples.cpp(381): note: see declaration of 'AsyncSugaredExamp
les_obj::simpleExample::_Function_1_1::run::_Function_3_1::__run'
./src/AsyncSugaredExamples.cpp(792): error C2365: 'AsyncSugaredExamples_obj::per
mutationsExample::_Function_2_1::run::_Function_4_1::__run': redefinition; previ
ous definition was 'data member'
./src/AsyncSugaredExamples.cpp(763): note: see declaration of 'AsyncSugaredExamp
les_obj::permutationsExample::_Function_2_1::run::_Function_4_1::__run'
./src/AsyncSugaredExamples.cpp(1027): error C2365: 'AsyncSugaredExamples_obj::ne
stedExample::_Function_1_1::run::_Function_3_1::__run': redefinition; previous d
efinition was 'data member'
./src/AsyncSugaredExamples.cpp(994): note: see declaration of 'AsyncSugaredExamp
les_obj::nestedExample::_Function_1_1::run::_Function_3_1::__run'
./src/AsyncSugaredExamples.cpp(1295): error C2365: 'AsyncSugaredExamples_obj::fi
bonacciExample::_Function_1_1::run::_Function_3_1::__run': redefinition; previou
s definition was 'data member'
./src/AsyncSugaredExamples.cpp(1262): note: see declaration of 'AsyncSugaredExam
ples_obj::fibonacciExample::_Function_1_1::run::_Function_3_1::__run'
./src/AsyncSugaredExamples.cpp(1628): error C2365: 'AsyncSugaredExamples_obj::se
ndExample::_Function_1_1::run::_Function_3_1::__run': redefinition; previous def
inition was 'data member'
./src/AsyncSugaredExamples.cpp(1595): note: see declaration of 'AsyncSugaredExam
ples_obj::sendExample::_Function_1_1::run::_Function_3_1::__run'
./src/AsyncSugaredExamples.cpp(1927): error C2365: 'AsyncSugaredExamples_obj::an
otherSendExample::_Function_1_1::run::_Function_3_1::__run': redefinition; previ
ous definition was 'data member'
./src/AsyncSugaredExamples.cpp(1894): note: see declaration of 'AsyncSugaredExam
ples_obj::anotherSendExample::_Function_1_1::run::_Function_3_1::__run'
./src/AsyncSugaredExamples.cpp(2212): error C2365: 'AsyncSugaredExamples_obj::fi
berExample::_Function_1_1::run::_Function_3_1::__run': redefinition; previous de
finition was 'data member'
./src/AsyncSugaredExamples.cpp(2179): note: see declaration of 'AsyncSugaredExam
ples_obj::fiberExample::_Function_1_1::run::_Function_3_1::__run'
./src/AsyncSugaredExamples.cpp(2500): error C2365: 'AsyncSugaredExamples_obj::fi
berFutureExample::_Function_1_1::run::_Function_3_1::__run': redefinition; previ
ous definition was 'data member'
./src/AsyncSugaredExamples.cpp(2467): note: see declaration of 'AsyncSugaredExam
ples_obj::fiberFutureExample::_Function_1_1::run::_Function_3_1::__run'
./src/AsyncSugaredExamples.cpp(2761): error C2365: 'AsyncSugaredExamples_obj::fi
berDurationExample::_Function_1_1::run::_Function_3_1::__run': redefinition; pre
vious definition was 'data member'
./src/AsyncSugaredExamples.cpp(2728): note: see declaration of 'AsyncSugaredExam
ples_obj::fiberDurationExample::_Function_1_1::run::_Function_3_1::__run'
__files__.cpp
__boot__.cpp
__resources__.cpp
Error: Build failed
Yikes. So far I've mostly tested it on neko and javascript. I haven't really tried it on static platforms. I'll try to get this working on static targets for the next release.
I tried to use moon-core straight out of the box to convert a function of mine to async, so that it could show a loading indicator while loading. I got some compiler errors.
So I tried to just compile the sugared async example, and got the same errors. Maybe my haxe 3.2.1 for win7x64 is the wrong environment? Or am I missing something else?
Here's trying to compile the example from the command line:
And here's from my project:
(...plus a few others specific to my project)