Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
e523db51
Commit
e523db51
authored
Feb 05, 2007
by
damienf
Browse files
- added support for visibility attribute for GCC 4.x for controlling export symbols
parent
ec497404
Changes
4
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
e523db51
...
...
@@ -1011,6 +1011,26 @@ if test "${ac_cv_c_omit_frame_pointer}" != "no"; then
VLC_ADD_CFLAGS([i420_yuy2_mmx],[-fomit-frame-pointer])
fi
dnl Check for -fvisibility=hidden
AC_CACHE_CHECK([if \$CC accepts -fvisibility=hidden],
[ac_cv_c_visibility_hidden],
[CFLAGS="${CFLAGS_save} -fvisibility=hidden"
AC_TRY_COMPILE([],,ac_cv_c_visibility_hidden=yes, ac_cv_c_visibility_hidden=no)])
if test "${ac_cv_c_visibility_hidden}" != "no"; then
VLC_ADD_CFLAGS([libvlc],[-fvisibility=hidden])
VLC_ADD_CFLAGS([plugin],[-fvisibility=hidden])
fi
dnl Check for -fvisibility-inlines-hidden
AC_CACHE_CHECK([if \$CC accepts -fvisibility-inlines-hidden],
[ac_cv_c_visibility_inlines_hidden],
[CFLAGS="${CFLAGS_save} -fvisibility-inlines-hidden"
AC_TRY_COMPILE([],,ac_cv_c_visibility_inlines_hidden=yes, ac_cv_c_visibility_inlines_hidden=no)])
if test "${ac_cv_c_visibility_inlines_hidden}" != "no"; then
VLC_ADD_CFLAGS([libvlc],[-fvisibility-inlines-hidden])
VLC_ADD_CFLAGS([plugin],[-fvisibility-inlines-hidden])
fi
dnl Check for -mdynamic-no-pic
AC_CACHE_CHECK([if \$CC accepts -mdynamic-no-pic],
[ac_cv_c_dynamic_no_pic],
...
...
@@ -1089,7 +1109,7 @@ if test "${ac_cv_c_attribute_format}" != "no"; then
AC_DEFINE(HAVE_ATTRIBUTE_FORMAT, 1, Support for __attribute__((format())) with function pointers)
fi
dnl Check for __attribute__(())
dnl Check for __attribute__((
packed
))
AC_CACHE_CHECK([for __attribute__((packed))],
[ac_cv_c_attribute_packed],
[ac_cv_c_attribute_packed=no
...
...
@@ -1099,6 +1119,16 @@ if test "${ac_cv_c_attribute_packed}" != "no"; then
AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
fi
dnl Check for __attribute__((visibility()))
AC_CACHE_CHECK([for __attribute__((visibility()))],
[ac_cv_c_attribute_visibility],
[ac_cv_c_attribute_visibility=no
AC_TRY_COMPILE(, [extern __attribute__((visibility("default"))) int foo(int);],
[ac_cv_c_attribute_visibility=yes])])
if test "${ac_cv_c_attribute_visibility}" != "no"; then
AC_DEFINE(HAVE_ATTRIBUTE_VISIBILITY, 1, Support for __attribute__((visibility())) for exporting symbols)
fi
dnl
dnl Check the CPU
dnl
...
...
include/vlc/vlc.h
View file @
e523db51
...
...
@@ -160,6 +160,8 @@ struct vlc_list_t
*****************************************************************************/
#if defined(WIN32) && defined(DLL_EXPORT)
# define VLC_PUBLIC_API extern __declspec(dllexport)
#elif HAVE_ATTRIBUTE_VISIBILITY
# define VLC_PUBLIC_API extern __attribute__((visibility("default")))
#else
# define VLC_PUBLIC_API extern
#endif
...
...
include/vlc_common.h
View file @
e523db51
...
...
@@ -480,6 +480,14 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *, /* variable's object */
# define VLC_EXPORT( type, name, args ) __declspec(dllexport) type name args
# define VLC_INTERNAL( type, name, args ) type name args
# endif
#elif HAVE_ATTRIBUTE_VISIBILITY
# ifdef __cplusplus
# define VLC_EXPORT( type, name, args ) extern "C" __attribute__((visibility("default"))) type name args
# define VLC_INTERNAL( type, name, args ) extern "C" __attribute__((visibility("hidden"))) type name args
# else
# define VLC_EXPORT( type, name, args ) __attribute__((visibility("default"))) type name args
# define VLC_INTERNAL( type, name, args ) __attribute__((visibility("hidden"))) type name args
# endif
#else
# if !defined (__PLUGIN__) || defined (HAVE_SHARED_LIBVLC)
# ifdef __cplusplus
...
...
include/vlc_modules_macros.h
View file @
e523db51
...
...
@@ -71,6 +71,9 @@
#if defined( __PLUGIN__ ) && ( defined( WIN32 ) || defined( UNDER_CE ) )
# define DLL_SYMBOL __declspec(dllexport)
# define CDECL_SYMBOL __cdecl
#elif HAVE_ATTRIBUTE_VISIBILITY
# define DLL_SYMBOL __attribute__((visibility("default")))
# define CDECL_SYMBOL
#else
# define DLL_SYMBOL
# define CDECL_SYMBOL
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment