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 MacOS UDR and Legacy_UserManager plugins not working due to not exported entry point. #7088
Conversation
…xported entry point. Add FB_DLL_EXPORT to public headers. Use default visibility also for Linux/Unix (in addition to MacOS) as user application can also be compiled with -fvisibility=hidden.
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) | ||
#define FB_DLL_EXPORT __declspec(dllexport) | ||
#elif defined(__APPLE__) || defined(__linux__) || defined(unix) || defined(__unix__) || defined(__unix) | ||
#define FB_DLL_EXPORT __attribute__ ((visibility("default"))) |
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'm not sure - does __attribute__ ((visibility("default"))) work in non-GCC case? I.e. is not check for unix too wide, may be something like check for defined(__GNUC__) should be added?
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.
Another problem here is that __declspec() must be used BEFORE function name while attribute() - AFTER it. I.e. declaration void FB_DLL_EXPORT foo()
won't work with GCC.
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'm not sure - does attribute ((visibility("default"))) work in non-GCC case? I.e. is not check for unix too wide, may be something like check for defined(GNUC) should be added?
Or maybe this?
https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005fattribute.html
On 12/24/21 19:39, Dimitry Sibiryakov wrote:
***@***.**** commented on this pull request.
------------------------------------------------------------------------
In src/include/ibase.h
<#7088 (comment)>:
> @@ -64,6 +64,14 @@
#define FB_API_DEPRECATED
#endif
+#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
+#define FB_DLL_EXPORT __declspec(dllexport)
+#elif defined(__APPLE__) || defined(__linux__) || defined(unix) || defined(__unix__) || defined(__unix)
+#define FB_DLL_EXPORT __attribute__ ((visibility("default")))
Another problem here is that __declspec() must be used BEFORE function
name while *attribute*() - AFTER it. I.e. declaration |void
FB_DLL_EXPORT foo()| won't work with GCC.
According to https://gcc.gnu.org/wiki/Visibility it works.
|
It looks like it can work in form |
On 12/24/21 20:00, Adriano dos Santos Fernandes wrote:
***@***.**** commented on this pull request.
------------------------------------------------------------------------
In src/include/ibase.h
<#7088 (comment)>:
> @@ -64,6 +64,14 @@
#define FB_API_DEPRECATED
#endif
+#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
+#define FB_DLL_EXPORT __declspec(dllexport)
+#elif defined(__APPLE__) || defined(__linux__) || defined(unix) || defined(__unix__) || defined(__unix)
+#define FB_DLL_EXPORT __attribute__ ((visibility("default")))
I'm not sure - does *attribute* ((visibility("default"))) work in
non-GCC case? I.e. is not check for unix too wide, may be
something like check for defined(*GNUC*) should be added?
Or maybe this?
https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005fattribute.html
Certainly, it's ok.
|
d6757d0
to
d074c94
Compare
…xported entry point. (FirebirdSQL#7088) Add FB_DLL_EXPORT to public headers. Use default visibility also for Linux/Unix (in addition to MacOS) as user application can also be compiled with -fvisibility=hidden.
…xported entry point. (#7088) Add FB_DLL_EXPORT to public headers. Use default visibility also for Linux/Unix (in addition to MacOS) as user application can also be compiled with -fvisibility=hidden.
…xported entry point. (#7088) Add FB_DLL_EXPORT to public headers. Use default visibility also for Linux/Unix (in addition to MacOS) as user application can also be compiled with -fvisibility=hidden.
Add FB_DLL_EXPORT to public headers.
Use default visibility also for Linux/Unix (in addition to MacOS) as
user application can also be compiled with -fvisibility=hidden.