colyseus / colyseus-haxe

⚔ Colyseus Multiplayer SDK for Haxe

Home Page:https://docs.colyseus.io/getting-started/haxe-client/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Protocol ERROR variable can cause conflicts in cpp builds with native libraries

Aidan63 opened this issue · comments

Hello, I'm having a go at adding colyseus into my project and started running across an issue with cpp builds where I was getting the MSVC C2059 error which occurs when a variable is using a reserved name. Seems like one of the native libraries I use defines ERROR and that causes conflicts with Protocol.Error, I was able to confirm this by adding @:headerCode('#undef ERROR') to the Protocol class and it compiled fine.

Changing Protocol to an enum abstract also worked fine as the compile injects the integer values so no possible chance for name clashes. Probably not strictly a colyseus issue but I thought I'd mention it as ERROR is probably fairly common cpp macros.

Cheers.

Thank you for reporting these issues @Aidan63, they are really helpful!

I did spend a lot of time making the Haxe client work back in 3.4.x, and again once Haxe 4.0.0 was released, but probably some things have changed since Haxe 4.1 and Haxe 4.2. 🤯

I'd really appreciate it if you can take some time to create a PR fixing any issue you may find, otherwise, if you can just report as you've been doing that also helps a lot!

Cheers!

No problem, I'll work on some PRs, should just be small fixes.

Thought I'd open issues first to make sure I wasn't completely barking up the wrong tree!