diff --git a/src/lib/ecore_audio/Ecore_Audio.h b/src/lib/ecore_audio/Ecore_Audio.h index 717c36c3fd..9283b0474f 100644 --- a/src/lib/ecore_audio/Ecore_Audio.h +++ b/src/lib/ecore_audio/Ecore_Audio.h @@ -3,32 +3,7 @@ #include #include - -#ifdef EAPI -#undef EAPI -#endif - -#ifdef _WIN32 -# ifdef EFL_BUILD -# ifdef DLL_EXPORT -# define EAPI __declspec(dllexport) -# else -# define EAPI -# endif -# else -# define EAPI __declspec(dllimport) -# endif -#else -# ifdef __GNUC__ -# if __GNUC__ >= 4 -# define EAPI __attribute__ ((visibility("default"))) -# else -# define EAPI -# endif -# else -# define EAPI -# endif -#endif +#include /** * @file Ecore_Audio.h @@ -176,7 +151,7 @@ typedef struct _Ecore_Audio_Vio Ecore_Audio_Vio; * When Ecore_Audio is not used anymore, call ecore_audio_shutdown() * to shut down the Ecore_Audio library. */ -EAPI int ecore_audio_init(void); +ECORE_AUDIO_API int ecore_audio_init(void); /** * @brief Shuts down the Ecore_Audio library. @@ -190,7 +165,7 @@ EAPI int ecore_audio_init(void); * been called the same number of times than ecore_audio_init(). In that case * it shuts down all the services it uses. */ -EAPI int ecore_audio_shutdown(void); +ECORE_AUDIO_API int ecore_audio_shutdown(void); //Legacy compatibility code @@ -200,14 +175,14 @@ EAPI int ecore_audio_shutdown(void); * @since 1.8 * */ -EAPI const char* ecore_audio_obj_name_get(const Efl_Object* obj); +ECORE_AUDIO_API const char* ecore_audio_obj_name_get(const Efl_Object* obj); /** * @brief Name of the object * * @since 1.8 * */ -EAPI void ecore_audio_obj_name_set(Efl_Object* obj, const char *name); +ECORE_AUDIO_API void ecore_audio_obj_name_set(Efl_Object* obj, const char *name); #include #include @@ -230,7 +205,4 @@ EAPI void ecore_audio_obj_name_set(Efl_Object* obj, const char *n } #endif -#undef EAPI -#define EAPI - #endif diff --git a/src/lib/ecore_audio/ecore_audio.c b/src/lib/ecore_audio/ecore_audio.c index be2e40c74c..91bf99b364 100644 --- a/src/lib/ecore_audio/ecore_audio.c +++ b/src/lib/ecore_audio/ecore_audio.c @@ -27,7 +27,7 @@ Ecore_Audio_Lib_Sndfile *ecore_audio_sndfile_lib = NULL; /* externally accessible functions */ -EAPI int +ECORE_AUDIO_API int ecore_audio_init(void) { @@ -60,7 +60,7 @@ ecore_audio_init(void) return _ecore_audio_init_count; } -EAPI int +ECORE_AUDIO_API int ecore_audio_shutdown(void) { DBG("Ecore_Audio shutdown"); @@ -263,13 +263,13 @@ ecore_audio_sndfile_lib_unload(void) #endif /* HAVE_SNDFILE */ -EAPI const char* +ECORE_AUDIO_API const char* ecore_audio_obj_name_get(const Efl_Object* obj) { return efl_name_get(obj); } -EAPI void +ECORE_AUDIO_API void ecore_audio_obj_name_set(Efl_Object* obj, const char *name) { efl_name_set(obj, name); diff --git a/src/lib/ecore_audio/ecore_audio_api.h b/src/lib/ecore_audio/ecore_audio_api.h new file mode 100644 index 0000000000..1ba364bfb5 --- /dev/null +++ b/src/lib/ecore_audio/ecore_audio_api.h @@ -0,0 +1,34 @@ +#ifndef _EFL_ECORE_AUDIO_API_H +#define _EFL_ECORE_AUDIO_API_H + +#ifdef ECORE_AUDIO_API +#error ECORE_AUDIO_API should not be already defined +#endif + +#ifdef _WIN32 +# ifndef ECORE_AUDIO_STATIC +# ifdef ECORE_AUDIO_BUILD +# define ECORE_AUDIO_API __declspec(dllexport) +# else +# define ECORE_AUDIO_API __declspec(dllimport) +# endif +# else +# define ECORE_AUDIO_API +# endif +# define ECORE_AUDIO_API_WEAK +#else +# ifdef __GNUC__ +# if __GNUC__ >= 4 +# define ECORE_AUDIO_API __attribute__ ((visibility("default"))) +# define ECORE_AUDIO_API_WEAK __attribute__ ((weak)) +# else +# define ECORE_AUDIO_API +# define ECORE_AUDIO_API_WEAK +# endif +# else +# define ECORE_AUDIO_API +# define ECORE_AUDIO_API_WEAK +# endif +#endif + +#endif diff --git a/src/lib/ecore_audio/meson.build b/src/lib/ecore_audio/meson.build index 0376968a4b..95ffddf5b5 100644 --- a/src/lib/ecore_audio/meson.build +++ b/src/lib/ecore_audio/meson.build @@ -24,6 +24,7 @@ foreach eo_file : pub_eo_files '-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'), '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'), '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'), + '-e', 'ECORE_AUDIO_API', '-gchd', '@INPUT@']) endforeach @@ -80,7 +81,7 @@ endif ecore_audio_lib = library('ecore_audio', ecore_audio_src, pub_eo_file_target, - c_args : package_c_args, + c_args : [package_c_args, '-DECORE_AUDIO_BUILD'], dependencies: ecore_audio_pub_deps + ecore_audio_deps + ecore_audio_ext_deps, include_directories : config_dir, install: true,