/* * decorators for definitions, depending on whether you want to use * -fvisibility=default or -fvisibility=hidden */ #define EXPORT __attribute__((visibility("default"))) #define HIDDEN __attribute__((visibility("hidden"))) /* * decorator for a definition that replaces an older definition with * the same name -- NAME must be declared in public header file, for * example `int64_t time(int64_t *)'; NAMEVER must be distinct, for * example `time64', and will be declared here */ #define DEFAULTSYMVER(NAME,NAMEVER,VER) \ __typeof(NAME) NAMEVER; \ __asm(".symver " #NAMEVER "," #NAME "@@" #VER); \ EXPORT /* * decorator for the older definition -- NAME must have been declared * in old version of public header file, for example `int32_t * time(int32_t *)', and its declaration moved to a private compat * header file as NAMEVER, for example `int32_t time32(int32_t *)' */ #define COMPATSYMVER(NAME,NAMEVER,VER) \ __asm(".symver " #NAMEVER "," #NAME "@" #VER); \ EXPORT /* * decorator for the declaration in a .h file shared by compat library * and real library */ #define PRIVATESYMDECL(NAME,VER) \ __asm(".symver " #NAME "," #NAME "@" #VER) /* decorator for the definition in the real library */ #define PRIVATESYM(NAME,VER) \ PRIVATESYMDECL(NAME,VER); \ EXPORT