[Mesa-dev] [PATCH mesa] loader: deduplicate logger function declaration
Eric Engestrom
eric.engestrom at intel.com
Fri Nov 16 12:37:46 UTC 2018
Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
---
src/loader/loader.c | 4 ++--
src/loader/loader.h | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/loader/loader.c b/src/loader/loader.c
index 461f96aa6a448272dedd..018989c201e047159b9a 100644
--- a/src/loader/loader.c
+++ b/src/loader/loader.c
@@ -64,7 +64,7 @@ static void default_logger(int level, const char *fmt, ...)
}
}
-static void (*log_)(int level, const char *fmt, ...) = default_logger;
+static loader_logger *log_ = default_logger;
int
loader_open_device(const char *device_name)
@@ -487,7 +487,7 @@ loader_get_driver_for_fd(int fd)
}
void
-loader_set_logger(void (*logger)(int level, const char *fmt, ...))
+loader_set_logger(loader_logger *logger)
{
log_ = logger;
}
diff --git a/src/loader/loader.h b/src/loader/loader.h
index 7b4dd01144f8cc36d66e..a194f7da60f84aee18a7 100644
--- a/src/loader/loader.h
+++ b/src/loader/loader.h
@@ -67,8 +67,9 @@ loader_get_user_preferred_fd(int default_fd, bool *different_device);
#define _LOADER_INFO 2 /* just useful info */
#define _LOADER_DEBUG 3 /* useful info for debugging */
+typedef void loader_logger(int level, const char *fmt, ...);
void
-loader_set_logger(void (*logger)(int level, const char *fmt, ...));
+loader_set_logger(loader_logger *logger);
char *
loader_get_extensions_name(const char *driver_name);
--
Cheers,
Eric
More information about the mesa-dev
mailing list