mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Changes for static build.
This commit is contained in:
parent
caa8d5372e
commit
27472b56a6
44 changed files with 362 additions and 158 deletions
|
|
@ -38,14 +38,45 @@
|
|||
#define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) /**< don't print warning when attribute is not used */
|
||||
#endif
|
||||
|
||||
/** helper macro for SND_DLSYM_BUILD_VERSION */
|
||||
#ifdef PIC /* dynamic build */
|
||||
|
||||
/** helper macro for SND_DLSYM_BUILD_VERSION \hideinitializer */
|
||||
#define __SND_DLSYM_VERSION(name, version) _ ## name ## version
|
||||
/** build version for versioned dynamic symbol */
|
||||
#define SND_DLSYM_BUILD_VERSION(name, version) char __SND_DLSYM_VERSION(name, version)
|
||||
/** build version for versioned dynamic symbol \hideinitializer */
|
||||
#define SND_DLSYM_BUILD_VERSION(name, version) char __SND_DLSYM_VERSION(name, version);
|
||||
|
||||
#else /* static build */
|
||||
|
||||
struct snd_dlsym_link {
|
||||
struct snd_dlsym_link *next;
|
||||
const char *dlsym_name;
|
||||
const void *dlsym_ptr;
|
||||
};
|
||||
|
||||
extern struct snd_dlsym_link *snd_dlsym_start;
|
||||
|
||||
/** helper macro for SND_DLSYM_BUILD_VERSION \hideinitializer */
|
||||
#define __SND_DLSYM_VERSION(prefix, name, version) _ ## prefix ## name ## version
|
||||
/** build version for versioned dynamic symbol \hideinitializer */
|
||||
#define SND_DLSYM_BUILD_VERSION(name, version) \
|
||||
static struct snd_dlsym_link __SND_DLSYM_VERSION(snd_dlsym_, name, version); \
|
||||
void __SND_DLSYM_VERSION(snd_dlsym_constructor_, name, version) (void) __attribute__ ((constructor)); \
|
||||
void __SND_DLSYM_VERSION(snd_dlsym_constructor_, name, version) (void) { \
|
||||
__SND_DLSYM_VERSION(snd_dlsym_, name, version).next = snd_dlsym_start; \
|
||||
__SND_DLSYM_VERSION(snd_dlsym_, name, version).dlsym_name = # name; \
|
||||
__SND_DLSYM_VERSION(snd_dlsym_, name, version).dlsym_ptr = (void *)&name; \
|
||||
snd_dlsym_start = &__SND_DLSYM_VERSION(snd_dlsym_, name, version); \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/** get version of dynamic symbol as string */
|
||||
#define SND_DLSYM_VERSION(version) __STRING(version)
|
||||
|
||||
int snd_dlsym_verify(void *handle, const char *name, const char *version);
|
||||
void *snd_dlopen(const char *file, int mode);
|
||||
void *snd_dlsym(void *handle, const char *name, const char *version);
|
||||
int snd_dlclose(void *handle);
|
||||
|
||||
|
||||
/** Async notification client handler */
|
||||
typedef struct _snd_async_handler snd_async_handler_t;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue