-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
please remove the dllexport of static libs #184
Comments
Maybe we can use MSVC macro "_DLL" to detect dll build vs static lib build.
|
As the default build system only build static libraries (#99), the easiest fix for this issue is just to define |
if you want to add that _DLL macro check under _WIN32 that's fine with me, that sounds very reasonable make PR plaes |
Now that I think of it, who is really building DLL of uSockets? That's really crappy for performance and should never be done. uSockets should always be a static lib |
Indeed, that is what I mentioned in #184 (comment) . Do you prefer to simply define |
This was handled in b950efd, thanks! |
hi,
Currently uWebSockets and its dependency "uSockets" define a macro "WIN32_EXPORT" in header file "libusockets.h", as the following.
So all uSockets api functions and a uWebSockets class named "struct WIN32_EXPORT WebSocketProtocol" will appear in exe/dll export tables even if we use their static libs.
Please remove "__declspec(dllexport)" for static lib build configuration. Thanks.
#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <winsock2.h>
#define LIBUS_SOCKET_DESCRIPTOR SOCKET
#define WIN32_EXPORT __declspec(dllexport)
#else
#define LIBUS_SOCKET_DESCRIPTOR int
#define WIN32_EXPORT
#endif
The text was updated successfully, but these errors were encountered: