-
Notifications
You must be signed in to change notification settings - Fork 210
Fix static MinGW build #245
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
Fix static MinGW build #245
Conversation
src/pcre2posix.h
Outdated
http://msdn2.microsoft.com/en-us/library/y4h7bcy6(VS.80).aspx. According to the | ||
information there, using __declspec(dllexport) without "extern" we have a | ||
definition; with "extern" we have a declaration. The settings here override the | ||
setting in pcre2.h (which is included below); it defines only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(which is included below)
this is not correct in this context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I amended the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks the non static build as shown by:
src/pcre2posix.c:62: warning: "PCRE2POSIX_EXP_DECL" redefined
62 | # define PCRE2POSIX_EXP_DECL extern __declspec(dllexport)
|
In file included from src/pcre2posix.c:52:
src/config.h:257: note: this is the location of the previous definition
257 | #define PCRE2POSIX_EXP_DECL extern __attribute__ ((visibility ("default")))
|
src/pcre2posix.c:63: warning: "PCRE2POSIX_EXP_DEFN" redefined
63 | # define PCRE2POSIX_EXP_DEFN __declspec(dllexport)
|
src/config.h:260: note: this is the location of the previous definition
260 | #define PCRE2POSIX_EXP_DEFN extern __attribute__ ((visibility ("default")))
|
This happens without this PR as well (commit 04fbb65). |
8548ef9
to
cd894c0
Compare
Removed the (superfluous) defines from |
Those defines weren't superfluous. As explained in the documentation[1] the code you are adding is linking to, you need to set them differently depending of if you are building the library or a program that uses it. There is an interesting takeaway from your accidental solution though, and it is that the [1] https://web.archive.org/web/20130907051123/http://msdn.microsoft.com/en-us/library/y4h7bcy6(VS.80).aspx |
Superceded by #249 |
Copied over the comments and macro tree from
src/pcre2_internal.h
, which I consider to be correctly.Fixes #243