speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/3] Factor out common audio module stuff into a macro


From: Boris Dušek
Subject: [PATCH 2/3] Factor out common audio module stuff into a macro
Date: Wed, 25 Jul 2012 13:16:14 +0200

>> +#define SPD_AUDIO_PLUGIN(modname) \
>> +    spd_audio_plugin_t * modname##_plugin_get(void) { return 
>> &modname##_functions; }\
>> +    spd_audio_plugin_t * SPD_AUDIO_PLUGIN_ENTRY (void) __attribute__ 
>> ((weak, alias(#modname "_plugin_get")));
> 
> I wonder if we can come up with a name that makes it clearer what this
> macro is for, maybe REGISTER_AUDIO_PLUGIN()? or
> GET_AUDIO_PLUGIN_VTABLE()?

yes, I will probably settle on SPD_AUDIO_DECLARE_PLUGIN and add 2 improvements:

1. generate the spd_audio_plugin_t structure in the macro as well 
2. remove the need for defining SPD_AUDIO_PLUGIN_ENTRY in the beginning
   of each audio module and generate the function name from modname in
   the macro

I will probably then split the macro in 2 to not have 1 huge that does
everything.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]