lunarmodules / luasocket

Network support for the Lua language
http://lunarmodules.github.io/luasocket/
MIT License
1.85k stars 630 forks source link

LUASOCKET_API macro definition #63

Open gares opened 11 years ago

gares commented 11 years ago

Instead of having -D flags passed around you could define the visibility of symbols by having a .h file that does so, like in http://gcc.gnu.org/wiki/Visibility

It's not radically different from your perspective (you move the idfefs from the makefile to this .h) but makes things way simpler if one wants to compile the sources with another build system. In particular most of the files compile fine, since there are default-value #ifndef for LUASOCKET_API etc, but not for all of them in all files (like in serial.c), and even if they compile -fvisibility=hidden + "extern" (the default value for LUASOCKET_API) does not work well (i.e. no exported symbols in socket.so for example).

starwing commented 11 years ago

and, why not simply define LUASOCKET_API and MIME_API and etc. to LUALIB_API?

just define LUA_LIB in every .c file before include lua.h.

ewestbrook commented 5 years ago

Does something need to be done here?

We're reviewing open items in preparation for a release. If action is needed here, please add a comment. Otherwise, this issue will be closed on or after 24-Feb-2019.

Thanks!