diff options
author | Sverker Eriksson <[email protected]> | 2016-01-13 18:41:09 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-01-13 18:41:09 +0100 |
commit | a00f5b7360b11991bee771638831e21cc4414b9b (patch) | |
tree | aa52c1e8fbb500b63014243764022692d62ceee0 /erts/emulator/beam/erl_driver.h | |
parent | 9c5c0a2169b1ac176fa9d66eab47c48ff8325a39 (diff) | |
parent | 1117dd3651be3cf763abf6fedcd4e06a6444fa04 (diff) | |
download | otp-a00f5b7360b11991bee771638831e21cc4414b9b.tar.gz otp-a00f5b7360b11991bee771638831e21cc4414b9b.tar.bz2 otp-a00f5b7360b11991bee771638831e21cc4414b9b.zip |
Merge branch 'sverk/fvisibility-hidden/OTP-13227'
* sverk/fvisibility-hidden/OTP-13227:
erts: Allow -fvisibility=hidden for NIFs and drivers
erts: Cleanup erl_driver.h for windows
erts: Refactor ERL_NIF_INIT macro
Diffstat (limited to 'erts/emulator/beam/erl_driver.h')
-rw-r--r-- | erts/emulator/beam/erl_driver.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/erts/emulator/beam/erl_driver.h b/erts/emulator/beam/erl_driver.h index bda4d5d1c6..0636171ad1 100644 --- a/erts/emulator/beam/erl_driver.h +++ b/erts/emulator/beam/erl_driver.h @@ -378,22 +378,23 @@ typedef struct erl_drv_entry { #ifdef STATIC_ERLANG_DRIVER # define ERLANG_DRIVER_NAME(NAME) NAME ## _driver_init +# define ERL_DRIVER_EXPORT #else # define ERLANG_DRIVER_NAME(NAME) driver_init +# if defined(__GNUC__) && __GNUC__ >= 4 +# define ERL_DRIVER_EXPORT __attribute__ ((visibility("default"))) +# elif defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550) +# define ERL_DRIVER_EXPORT __global +# else +# define ERL_DRIVER_EXPORT +# endif #endif -/* For windows dynamic drivers */ #ifndef ERL_DRIVER_TYPES_ONLY -#if defined(__WIN32__) -# define DRIVER_INIT(DRIVER_NAME) \ - __declspec(dllexport) ErlDrvEntry* ERLANG_DRIVER_NAME(DRIVER_NAME)(void); \ - __declspec(dllexport) ErlDrvEntry* ERLANG_DRIVER_NAME(DRIVER_NAME)(void) -#else -# define DRIVER_INIT(DRIVER_NAME) \ - ErlDrvEntry* ERLANG_DRIVER_NAME(DRIVER_NAME)(void); \ - ErlDrvEntry* ERLANG_DRIVER_NAME(DRIVER_NAME)(void) -#endif +#define DRIVER_INIT(DRIVER_NAME) \ + ERL_DRIVER_EXPORT ErlDrvEntry* ERLANG_DRIVER_NAME(DRIVER_NAME)(void); \ + ERL_DRIVER_EXPORT ErlDrvEntry* ERLANG_DRIVER_NAME(DRIVER_NAME)(void) #define ERL_DRV_BUSY_MSGQ_DISABLED (~((ErlDrvSizeT) 0)) #define ERL_DRV_BUSY_MSGQ_READ_ONLY ((ErlDrvSizeT) 0) |