diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2016-11-09 15:50:05 +0100 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2016-11-15 15:55:33 +0000 |
commit | 0890aa6f7fdbe33721b8ef2039608390c5aa886e (patch) | |
tree | 9e7738b5c774ed9247ae8e2f4785163f0691f6a4 /src/loader | |
parent | 0639e253a5fe796e0815ada86086f6e64d1a701a (diff) |
loader: add loader_get_extensions_name(..) helper
Changes since v1:
- renamed function to loader_get_extensions_name
- moved function into loader
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
V2: [Emil Velikov]
- Use local define.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Diffstat (limited to 'src/loader')
-rw-r--r-- | src/loader/loader.c | 19 | ||||
-rw-r--r-- | src/loader/loader.h | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/loader/loader.c b/src/loader/loader.c index fe90307765..fd05f08e64 100644 --- a/src/loader/loader.c +++ b/src/loader/loader.c @@ -396,3 +396,22 @@ loader_set_logger(void (*logger)(int level, const char *fmt, ...)) { log_ = logger; } + +/* XXX: Local definition to avoid pulling the heavyweight GL/gl.h and + * GL/internal/dri_interface.h + */ + +#ifndef __DRI_DRIVER_GET_EXTENSIONS +#define __DRI_DRIVER_GET_EXTENSIONS "__driDriverGetExtensions" +#endif + +char * +loader_get_extensions_name(const char *driver_name) +{ + char *name = NULL; + + if (asprintf(&name, "%s_%s", __DRI_DRIVER_GET_EXTENSIONS, driver_name) < 0) + return NULL; + + return name; +} diff --git a/src/loader/loader.h b/src/loader/loader.h index d404f5b67f..84314a4fc0 100644 --- a/src/loader/loader.h +++ b/src/loader/loader.h @@ -65,6 +65,8 @@ loader_get_user_preferred_fd(int default_fd, int *different_device); void loader_set_logger(void (*logger)(int level, const char *fmt, ...)); +char * +loader_get_extensions_name(const char *driver_name); #ifdef __cplusplus } |