Browse Source

Hide private symbols (issue #33).

tags/v0.99.beta20
Yury Gribov 6 years ago
parent
commit
726ede6491
4 changed files with 16 additions and 0 deletions
  1. +2
    -0
      caca/caca.h
  2. +2
    -0
      caca/caca0.h
  3. +10
    -0
      configure.ac
  4. +2
    -0
      cxx/caca++.h

+ 2
- 0
caca/caca.h View File

@@ -33,6 +33,8 @@
# define __extern extern __declspec(dllexport)
#elif defined _WIN32 && !defined __LIBCACA__ && !defined CACA_STATIC
# define __extern extern __declspec(dllimport)
#elif defined CACA_ENABLE_VISIBILITY
# define __extern extern __attribute__((visibility("default")))
#else
# define __extern extern
#endif


+ 2
- 0
caca/caca0.h View File

@@ -26,6 +26,8 @@
# define __extern extern __declspec(dllexport)
#elif defined _WIN32 && !defined __LIBCACA__
# define __extern extern __declspec(dllimport)
#elif defined CACA_ENABLE_VISIBILITY
# define __extern extern __attribute__((visibility("default")))
#else
# define __extern extern
#endif


+ 10
- 0
configure.ac View File

@@ -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"
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=""

# Build the C++ bindings?


+ 2
- 0
cxx/caca++.h View File

@@ -26,6 +26,8 @@
#undef __class
#if defined(_WIN32) && defined(__LIBCACA_PP__)
# define __class class __declspec(dllexport)
#elif defined CACA_ENABLE_VISIBILITY
# define __class class __attribute__((visibility("default")))
#else
# define __class class
#endif


Loading…
Cancel
Save