Skip to content
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

Merged
merged 4 commits into from Dec 26, 2021

Conversation

asfernandes
Copy link
Member

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.

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")))
Copy link
Member

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?

Copy link
Contributor

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.

Copy link
Member Author

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

@AlexPeshkoff
Copy link
Member

AlexPeshkoff commented Dec 24, 2021 via email

@aafemt
Copy link
Contributor

aafemt commented Dec 24, 2021

It looks like it can work in form FB_DLL_EXPORT void foo() though I remember to have a problem with it on Linux where GCC issued warning about attribute have no effect.

@AlexPeshkoff
Copy link
Member

AlexPeshkoff commented Dec 24, 2021 via email

@asfernandes asfernandes merged commit 9772a39 into master Dec 26, 2021
@asfernandes asfernandes deleted the work/macos-plugins branch December 26, 2021 14:35
asfernandes added a commit to asfernandes/firebird that referenced this pull request Dec 27, 2021
…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.
asfernandes added a commit that referenced this pull request Dec 27, 2021
…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.
asfernandes added a commit that referenced this pull request Dec 27, 2021
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants