/**
* Current plugin ABI version
*/
-# define MODULE_SYMBOL 1_2_0b
-# define MODULE_SUFFIX "__1_2_0b"
+# define MODULE_SYMBOL 1_2_0c
+# define MODULE_SUFFIX "__1_2_0c"
/*****************************************************************************
* Add a few defines. You do not want to read this section. Really.
goto error;
#define add_shortcut( ... ) \
+{ \
+ const char *shortcuts[] = { __VA_ARGS__ }; \
if (vlc_module_set (p_submodule, VLC_MODULE_SHORTCUT, \
- sizeof((const char*[]){__VA_ARGS__})/sizeof(const char*), __VA_ARGS__)) \
- goto error;
+ sizeof(shortcuts)/sizeof(shortcuts[0]), shortcuts)) \
+ goto error; \
+}
#define set_shortname( shortname ) \
if (vlc_module_set (p_submodule, VLC_MODULE_SHORTNAME, \
{
unsigned i_shortcuts = va_arg (ap, unsigned);
unsigned index = module->i_shortcuts;
- module->i_shortcuts += i_shortcuts;
-
- module->pp_shortcuts = realloc (module->pp_shortcuts, sizeof( char ** ) * module->i_shortcuts);
- for (; index < module->i_shortcuts; index++)
+ const char *const *tab = va_arg (ap, const char *const *);
+ const char **pp = realloc (module->pp_shortcuts,
+ sizeof (pp[0]) * (index + i_shortcuts));
+ if (unlikely(pp == NULL))
{
- const char *psz_new = va_arg (ap, const char*);
- module->pp_shortcuts[index] = psz_new;
+ ret = -1;
+ break;
}
+ module->pp_shortcuts = pp;
+ module->i_shortcuts = index + i_shortcuts;
+ memcpy (pp + index, tab, sizeof (pp[0]) * i_shortcuts);
break;
}