[vlc-commits] Mark exported symbols with default visibility on GCC 4
Rémi Denis-Courmont
git at videolan.org
Sat May 7 18:41:57 CEST 2011
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat May 7 19:12:20 2011 +0300| [d95990dc0c31411d05fcd9968810fc495a94f97e] | committer: Rémi Denis-Courmont
Mark exported symbols with default visibility on GCC 4
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d95990dc0c31411d05fcd9968810fc495a94f97e
---
include/vlc/libvlc.h | 2 ++
include/vlc_common.h | 6 +++---
include/vlc_plugin.h | 13 ++++++++++---
3 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/include/vlc/libvlc.h b/include/vlc/libvlc.h
index 43acdeb..5bd27e4 100644
--- a/include/vlc/libvlc.h
+++ b/include/vlc/libvlc.h
@@ -40,6 +40,8 @@
#if defined (WIN32) && defined (DLL_EXPORT)
# define VLC_PUBLIC_API __declspec(dllexport)
+#elif defined (__GNUC__) && (__GNUC__ >= 4)
+# define VLC_PUBLIC_API __attribute__((visibility("default")))
#else
# define VLC_PUBLIC_API
#endif
diff --git a/include/vlc_common.h b/include/vlc_common.h
index c2fa61b..1d02834 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -115,10 +115,10 @@
# define LIBVLC_EXTERN
#endif
-#if defined (__GNUC__) && (__GNUC__ >= 4)
-# define LIBVLC_EXPORT __attribute__((visibility("default")))
-#elif defined (WIN32) && defined (DLL_EXPORT)
+#if defined (WIN32) && defined (DLL_EXPORT)
# define LIBVLC_EXPORT __declspec(dllexport)
+#elif defined (__GNUC__) && (__GNUC__ >= 4)
+# define LIBVLC_EXPORT __attribute__((visibility("default")))
#else
# define LIBVLC_EXPORT
#endif
diff --git a/include/vlc_plugin.h b/include/vlc_plugin.h
index 5beee1a..d03dd59 100644
--- a/include/vlc_plugin.h
+++ b/include/vlc_plugin.h
@@ -140,12 +140,19 @@ enum vlc_module_properties
# define __VLC_SYMBOL( symbol ) CONCATENATE( symbol, MODULE_NAME )
#endif
-#if defined( __PLUGIN__ ) && ( defined( WIN32 ) || defined( UNDER_CE ) )
+#define CDECL_SYMBOL
+#if defined (__PLUGIN__)
+# if defined (WIN32)
# define DLL_SYMBOL __declspec(dllexport)
+# undef CDECL_SYMBOL
# define CDECL_SYMBOL __cdecl
+# elif defined (__GNUC__) && (__GNUC__ >= 4)
+# define DLL_SYMBOL __attribute__((visibility("default")))
+# else
+# define DLL_SYMBOL
+# endif
#else
-# define DLL_SYMBOL
-# define CDECL_SYMBOL
+# define DLL_SYMBOL
#endif
#if defined( __cplusplus )
More information about the vlc-commits
mailing list