plugin: define MODULE_STRING as the string version of MODULE_NAME

If MODULE_STRING is not defined just use a default name.
If MODULE_NAME is not set either it's a dynamic plugin and the MODULE_STRING
should be set, or it's an internal test and we don't care about the name.
This commit is contained in:
Steve Lhomme 2023-03-02 10:29:58 +01:00
parent 26b9e6360a
commit 41d6cb4695
1 changed files with 6 additions and 0 deletions

View File

@ -233,6 +233,8 @@ enum vlc_config_subcat
/* I need to do _this_ to change « foo bar » to « module_foo_bar » ! */
#define CONCATENATE( y, z ) CRUDE_HACK( y, z )
#define CRUDE_HACK( y, z ) y##__##z
#define STRINGIFY_NAME_( z ) #z
#define STRINGIFY_NAME( z ) STRINGIFY_NAME_( z )
#if defined(__cplusplus)
#define EXTERN_SYMBOL extern "C"
@ -240,6 +242,10 @@ enum vlc_config_subcat
#define EXTERN_SYMBOL
#endif
#if !defined(MODULE_STRING) && defined(MODULE_NAME)
# define MODULE_STRING STRINGIFY_NAME(MODULE_NAME)
#endif
/* If the module is built-in, then we need to define foo_InitModule instead
* of InitModule. Same for Activate- and DeactivateModule. */
#ifdef VLC_DYNAMIC_PLUGIN