Ok, I'll admit that this has been bothering me for a while (mainly because I'm a bit OCD).
Snippet taken from:
// standard functions
#ifdef PLUGIN_CLIENT
#define OS_FUNCTION( fid, fret, fname, ... ) enum { os_##fname = fid }; fret (*fname) (__VA_ARGS__);
#define IMPORT_FUNC( v ) v = get_function( os_##v )
#else
#define REGISTER_PLUGIN_COMMAND( fid, ffunc ) \
__attribute__((section(".plugin_commands"))) \
__attribute__((used)) \
static struct os_command _os_command_##fid##_block = { \
.id = fid, \
.func = (void*)ffunc, \
}
#ifdef PLUGIN_C_FILE // only include this from the plugin.c file
#define OS_FUNCTION( fid, fret, fname, ... ) extern fret fname (__VA_ARGS__); REGISTER_PLUGIN_COMMAND( fid, fname );
#else
#define OS_FUNCTION( fid, fret, fname, ... ) extern fret fname (__VA_ARGS__);
#endif // PLUGIN_C_FILE
#endif // PLUGIN_CLIENT
As far as I could understand the OS_FUNCTION macro is used for two things:
1) Static type-checking for some DryOS functions
2) Exporting them to the plugin interface (ruby) using an unique function_id
If this information is correct, why do we have OS_FUNCTION macros all over the place instaad of inside the "dryos.h" header ?