From 64dd5df14145b95ee1730468c43afd60bfc7600a Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Thu, 21 Aug 2014 12:29:48 +0000 Subject: Enable symbol visibility on Linux, bringing a shared libfltk on par with Windows. Also drops the size of libfltk.so nicely. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10236 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl_Export.H | 2 ++ configure.in | 2 ++ src/Fl_x.cxx | 1 + src/numericsort.c | 4 ++-- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/FL/Fl_Export.H b/FL/Fl_Export.H index 39a3ef627..c239910eb 100644 --- a/FL/Fl_Export.H +++ b/FL/Fl_Export.H @@ -29,6 +29,8 @@ # else # define FL_EXPORT __declspec(dllimport) # endif /* FL_LIBRARY */ +# elif __GNUC__ >= 4 +# define FL_EXPORT __attribute__ ((visibility ("default"))) # else # define FL_EXPORT # endif /* FL_DLL */ diff --git a/configure.in b/configure.in index d8f99d1dd..f9c64da30 100644 --- a/configure.in +++ b/configure.in @@ -255,6 +255,8 @@ if test x$enable_shared = xyes; then IMGDSONAME="libfltk_images.so.$FL_API_VERSION" CAIRODSONAME="libfltk_cairo.so.$FL_API_VERSION" DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o" + OPTIM="$OPTIM -fvisibility=hidden" + CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden" if test "x$libdir" != "x/usr/lib" -a "x$libdir" != "x/usr/lib64"; then DSOLINK="-Wl,-rpath,$libdir" fi diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 758ee5491..65446af1c 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -36,6 +36,7 @@ # include # include # include +# include # include # include # include "flstring.h" diff --git a/src/numericsort.c b/src/numericsort.c index 498a13d7e..8ffe94aec 100644 --- a/src/numericsort.c +++ b/src/numericsort.c @@ -39,10 +39,10 @@ # include # endif /* HAVE_NDIR_H */ # endif /* HAVE_DIRENT_H */ -#else /* For WIN32 variants */ -# include #endif /* !WIN32 || __CYGWIN__ */ +#include + /* * 'numericsort()' - Compare two directory entries, possibly with * a case-insensitive comparison... -- cgit v1.2.3