I'm not sure if this is possible, but I would like to create a shared object file and I would like to make it easy to use by having a #define that can be used to dereference the function names.
In libfoo.h
#define FOO_SO_FUNCTION_A aFunction
In libfoo.so
#include "libfoo/libfoo.h"
extern "C" int FOO_SO_FUNCTION_A( void )
{
...
}
In clientfoo
#include "libfoo/libfoo.h"
...
libfoofunc = dlsym( libfoo, MAKE_STRING(FOO_SO_FUNCTION_A) );
My problem is that
#FOO_SO_FUNCTION_A
Will simply change into "FOO_SO_FUNCTION_A" because the preprocessor rightfully only runs once. Is there another way to accomplish this?