endif
# Symbol visibility
-if cc.get_id() == 'msvc'
- export_define = '__declspec(dllexport) extern'
-elif cc.has_argument('-fvisibility=hidden')
+if cc.has_argument('-fvisibility=hidden')
add_project_arguments('-fvisibility=hidden', language: 'c')
- export_define = 'extern __attribute__ ((visibility ("default")))'
-else
- export_define = 'extern'
endif
-# Passing this through the command line would be too messy
-cdata.set('GST_API_EXPORT', export_define)
-
configure_file(output : 'config.h', configuration : cdata)
validate_plugins_install_dir = '@0@/gstreamer-1.0/validate'.format(get_option('libdir'))
endif
# Symbol visibility
-if cc.get_id() == 'msvc'
- export_define = '__declspec(dllexport) extern'
-elif cc.has_argument('-fvisibility=hidden')
+if cc.has_argument('-fvisibility=hidden')
add_project_arguments('-fvisibility=hidden', language: 'c')
- export_define = 'extern __attribute__ ((visibility ("default")))'
-else
- export_define = 'extern'
endif
-# Passing this through the command line would be too messy
-cdata.set('GST_API_EXPORT', export_define)
-
# Disable strict aliasing
if cc.has_argument('-fno-strict-aliasing')
add_project_arguments('-fno-strict-aliasing', language: 'c')
endif
# Symbol visibility
-if cc.get_id() == 'msvc'
- export_define = '__declspec(dllexport) extern'
-elif cc.has_argument('-fvisibility=hidden')
+if cc.has_argument('-fvisibility=hidden')
add_project_arguments('-fvisibility=hidden', language: 'c')
add_project_arguments('-fvisibility=hidden', language: 'cpp')
if have_objc
add_project_arguments('-fvisibility=hidden', language: 'objc')
endif
- export_define = 'extern __attribute__ ((visibility ("default")))'
-else
- export_define = 'extern'
endif
-# Passing this through the command line would be too messy
-cdata.set('GST_API_EXPORT', export_define)
-
# Disable strict aliasing
if cc.has_argument('-fno-strict-aliasing')
add_project_arguments('-fno-strict-aliasing', language: 'c')
core_conf.set('ENABLE_NLS', 1)
# Symbol visibility
-if cc.get_id() == 'msvc'
- export_define = '__declspec(dllexport) extern'
-elif cc.has_argument('-fvisibility=hidden')
+if cc.has_argument('-fvisibility=hidden')
add_project_arguments('-fvisibility=hidden', language: 'c')
if have_objc
add_project_arguments('-fvisibility=hidden', language: 'objc')
endif
- export_define = 'extern __attribute__ ((visibility ("default")))'
-else
- export_define = 'extern'
endif
-# Passing this through the command line would be too messy
-core_conf.set('GST_API_EXPORT', export_define)
-
# Disable strict aliasing
if cc.has_argument('-fno-strict-aliasing')
add_project_arguments('-fno-strict-aliasing', language: 'c')
endif
# Symbol visibility
-if cc.get_id() == 'msvc'
- export_define = '__declspec(dllexport) extern'
-elif cc.has_argument('-fvisibility=hidden')
+if cc.has_argument('-fvisibility=hidden')
add_project_arguments('-fvisibility=hidden', language: 'c')
- export_define = 'extern __attribute__ ((visibility ("default")))'
-else
- export_define = 'extern'
endif
-# Passing this through the command line would be too messy
-cdata.set('GST_API_EXPORT', export_define)
-
# Disable strict aliasing
if cc.has_argument('-fno-strict-aliasing')
add_project_arguments('-fno-strict-aliasing', language: 'c')
# error "Could not detect architecture; don't know whether it supports unaligned access! Please file a bug."
#endif
-/**
- * GST_EXPORT:
- *
- * Export the given variable from the built shared object.
- *
- * On Windows, this exports the variable from the DLL.
- * On other platforms, this gets defined to "extern".
- */
+#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(GST_STATIC_COMPILATION)
+# define _GST_EXPORT __declspec(dllexport)
+# define _GST_IMPORT __declspec(dllimport)
+#elif __GNUC__ >= 4
+# define _GST_EXPORT __attribute__((visibility("default")))
+# define _GST_IMPORT
+#else
+# define _GST_EXPORT
+# define _GST_IMPORT
+#endif
+
+#define GST_API_EXPORT _GST_EXPORT extern
+#define GST_API_IMPORT _GST_IMPORT extern
+
+#ifdef BUILDING_GST
+# define GST_API GST_API_EXPORT
+#else
+# define GST_API GST_API_IMPORT
+#endif
+
/**
* GST_PLUGIN_EXPORT:
*
* On Windows, this exports the plugin definition from the DLL.
* On other platforms, this gets defined as a no-op.
*/
-/* Only use __declspec(dllexport/import) when we have been built with MSVC or
- * the user is linking to us with MSVC. The only remaining case is when we were
- * built with MinGW and are linking with MinGW in which case we rely on the
- * linker to auto-export/import symbols. Of course all this is only used when
- * not linking statically.
- *
- * NOTE: To link to GStreamer statically on Windows, you must define
- * GST_STATIC_COMPILATION or the prototypes will cause the compiler to search
- * for the symbol inside a DLL.
- */
-#if (@GSTCONFIG_BUILT_WITH_MSVC@ || defined(_MSC_VER)) && !defined(GST_STATIC_COMPILATION)
-# define GST_PLUGIN_EXPORT __declspec(dllexport)
-# ifdef GST_EXPORTS
-# define GST_EXPORT __declspec(dllexport)
-# else
-# define GST_EXPORT __declspec(dllimport) extern
-# endif
-#else
-# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
-# define GST_PLUGIN_EXPORT __attribute__ ((visibility ("default")))
-# define GST_EXPORT extern __attribute__ ((visibility ("default")))
-# else
-# define GST_PLUGIN_EXPORT
-# define GST_EXPORT extern
-# endif
-#endif
+#define GST_PLUGIN_EXPORT _GST_EXPORT
-#if defined(_MSC_VER) && !defined(GST_STATIC_COMPILATION)
-# define GST_API_IMPORT __declspec(dllimport) extern
+/**
+ * GST_EXPORT:
+ *
+ * Export the given variable from the built shared object.
+ *
+ * On Windows, this exports the variable from the DLL.
+ * On other platforms, this gets defined to "extern".
+ * Deprecated: 1.22: Applications should define their own export macros.
+ */
+#ifdef GST_EXPORTS
+# define GST_EXPORT GST_API_EXPORT
#else
-# define GST_API_IMPORT extern
-#endif
-
-#ifndef GST_API
-# ifdef BUILDING_GST
-# define GST_API GST_API_EXPORT /* from config.h */
-# else
-# define GST_API GST_API_IMPORT
-# endif
+# define GST_EXPORT GST_API_IMPORT
#endif
/* These macros are used to mark deprecated functions in GStreamer headers,
internal_check_h_inc = include_directories('..')
# Must explicitly make symbols public if default visibility is hidden
-if have_visibility_hidden
+if host_system in ['windows', 'cygwin'] and not static_build
+ libcheck_visibility_args = ['-DCK_DLL_EXP=extern __declspec(dllexport)']
+elif have_visibility_hidden
libcheck_visibility_args = ['-DCK_DLL_EXP=extern __attribute__ ((visibility ("default")))']
else
- if host_system == 'windows'
- libcheck_visibility_args = ['-DCK_DLL_EXP=__declspec(dllexport)']
- else
- libcheck_visibility_args = ['-DCK_DLL_EXP=extern']
- endif
+ libcheck_visibility_args = ['-DCK_DLL_EXP=extern']
endif
no_warn_args = []
# Symbol visibility
have_visibility_hidden = false
-if cc.get_id() == 'msvc'
- export_define = '__declspec(dllexport) extern'
-elif cc.has_argument('-fvisibility=hidden')
+if cc.has_argument('-fvisibility=hidden')
add_project_arguments('-fvisibility=hidden', language: 'c')
- export_define = 'extern __attribute__ ((visibility ("default")))'
have_visibility_hidden = true
-else
- export_define = 'extern'
endif
-# Passing this through the command line would be too messy
-cdata.set('GST_API_EXPORT', export_define)
-
# Disable strict aliasing
if cc.has_argument('-fno-strict-aliasing')
add_project_arguments('-fno-strict-aliasing', language: 'c')
# All supported platforms have long long now
cdata.set('HAVE_LONG_LONG', 1)
-# We only want to use the __declspec(dllexport/import) dance in GST_EXPORT when
-# building with MSVC
-if cc.get_id() == 'msvc'
- cdata.set('GSTCONFIG_BUILT_WITH_MSVC', 1)
-else
- cdata.set('GSTCONFIG_BUILT_WITH_MSVC', 0)
-endif
-
# -------------------------------------------------------------------------------------
# config.h things needed by libcheck
# -------------------------------------------------------------------------------------