snowkit / linc_sdl

http://snowkit.github.io/linc/ Haxe/hxcpp @:native bindings for SDL
Other
30 stars 15 forks source link

Windows builds broken with cl.exe #20

Closed Sunjammer closed 6 years ago

Sunjammer commented 6 years ago

These lines

#ifndef HXCPP_H
#include <hxcpp.h>
#endif

are not valid on windows with cl.exe. Anything before the include statement for a precompiled header is ignored, making the #endif a syntax error

Sunjammer commented 6 years ago

This is currently true for "all" official snowkit linc libs :/

Sunjammer commented 6 years ago

Note that if this is fixed in one library, the problem goes away for others since at that time HXCPP_H is defined. It becomes compile order dependent at that point.

ruby0x1 commented 6 years ago

@hughsando see here?

hughsando commented 6 years ago

So the solution is to either: a) not use pch, or b) rely on the cpp to include hxcpp.h (first), and never do it in a header file. For b), you could do something like:

#ifndef HXCPP_H
#error "Please include hxcpp.h from your cpp file"
#endif
ruby0x1 commented 6 years ago

I took out the cpp part so should be fine now. Sorry for the delay, I didn't have anything set up on windows side for this toolchain.