Hide private symbols (issue #33).tags/v0.99.beta20
| @@ -33,6 +33,8 @@ | |||||
| # define __extern extern __declspec(dllexport) | # define __extern extern __declspec(dllexport) | ||||
| #elif defined _WIN32 && !defined __LIBCACA__ && !defined CACA_STATIC | #elif defined _WIN32 && !defined __LIBCACA__ && !defined CACA_STATIC | ||||
| # define __extern extern __declspec(dllimport) | # define __extern extern __declspec(dllimport) | ||||
| #elif defined CACA_ENABLE_VISIBILITY | |||||
| # define __extern extern __attribute__((visibility("default"))) | |||||
| #else | #else | ||||
| # define __extern extern | # define __extern extern | ||||
| #endif | #endif | ||||
| @@ -26,6 +26,8 @@ | |||||
| # define __extern extern __declspec(dllexport) | # define __extern extern __declspec(dllexport) | ||||
| #elif defined _WIN32 && !defined __LIBCACA__ | #elif defined _WIN32 && !defined __LIBCACA__ | ||||
| # define __extern extern __declspec(dllimport) | # define __extern extern __declspec(dllimport) | ||||
| #elif defined CACA_ENABLE_VISIBILITY | |||||
| # define __extern extern __attribute__((visibility("default"))) | |||||
| #else | #else | ||||
| # define __extern extern | # define __extern extern | ||||
| #endif | #endif | ||||
| @@ -387,6 +387,16 @@ CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer" | |||||
| CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare" | CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare" | ||||
| CXXFLAGS="${CXXFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Wsign-compare" | CXXFLAGS="${CXXFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Wsign-compare" | ||||
| dnl Visibility annotations... | |||||
| saved_CFLAGS="$CFLAGS" | |||||
| CFLAGS="$CFLAGS -fvisibility=hidden -Wall -Werror" | |||||
| AC_MSG_CHECKING(whether compiler supports visibility annotations) | |||||
| AC_COMPILE_IFELSE([AC_LANG_SOURCE([[void __attribute__((visibility("default"))) foo(void); void foo(void) {}]])], | |||||
| [CFLAGS="$saved_CFLAGS -fvisibility=hidden -DCACA_ENABLE_VISIBILITY"; | |||||
| AC_MSG_RESULT(yes)], | |||||
| [CFLAGS="$saved_CFLAGS" | |||||
| AC_MSG_RESULT(no)]) | |||||
| CACA_BINDINGS="" | CACA_BINDINGS="" | ||||
| # Build the C++ bindings? | # Build the C++ bindings? | ||||
| @@ -26,6 +26,8 @@ | |||||
| #undef __class | #undef __class | ||||
| #if defined(_WIN32) && defined(__LIBCACA_PP__) | #if defined(_WIN32) && defined(__LIBCACA_PP__) | ||||
| # define __class class __declspec(dllexport) | # define __class class __declspec(dllexport) | ||||
| #elif defined CACA_ENABLE_VISIBILITY | |||||
| # define __class class __attribute__((visibility("default"))) | |||||
| #else | #else | ||||
| # define __class class | # define __class class | ||||
| #endif | #endif | ||||