clsocket
clsocket copied to clipboard
EXPORT definition might collide easily
#define EXPORT __declspec(dllexport)
is defined in Host.h include from other public headers (SimpleSocket.h), with guard #ifdef _MSC_VER
.
however this definition might collide easily with user code using CLsocket.
i'd suggest to rename EXPORT into CLSOCKET_EXPORT .. [ and possibly make this definition only when having an additional private definition in CMakeLists.txt, e.g. when compiling the shared library ]
Sounds good to me - probably something I should have thought about in #17
now have also a commit for this issue in PR https://github.com/DFHack/clsocket/pull/4 might need some more testing on Windows - but it got late for today.
different from my own suggestion i renamed EXPORT to CLSOCKET_API, and also added dllimport .. and activate that only when compiling the shared library.
Looks awesome, thanks for the fix! Saves me from having to address https://github.com/DFHack/clsocket/pull/17#issuecomment-680125404. That was on my to-do list, so I'll take a closer look at #4, hopefully soon.