From: Philippe Proulx Date: Fri, 14 Jun 2019 21:12:36 +0000 (-0400) Subject: lib: plugin.h: force header user to include "lib/logging.h" X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=d3207ebf1d1c1f83865764590bbb635dd028403c lib: plugin.h: force header user to include "lib/logging.h" This pattern is found in other headers where, instead of including the logging header for the user, we ask her to set up the logging and then include the header. Signed-off-by: Philippe Proulx Change-Id: I922b09f63eff41b9c3ba30df7ace0b8b30b5b5b2 Reviewed-on: https://review.lttng.org/c/babeltrace/+/1443 Tested-by: jenkins Reviewed-by: Francis Deslauriers --- diff --git a/src/lib/plugin/plugin.h b/src/lib/plugin/plugin.h index d62bfb55..6d9b288d 100644 --- a/src/lib/plugin/plugin.h +++ b/src/lib/plugin/plugin.h @@ -31,11 +31,15 @@ #include "lib/object.h" #include #include "common/assert.h" -#include "lib/lib-logging.h" #include #include "plugin-so.h" +/* Protection: this file uses BT_LIB_LOG*() macros directly */ +#ifndef BABELTRACE_LIB_LOGGING_INTERNAL_H +# error Please include "lib/lib-logging.h" before including this file. +#endif + enum bt_plugin_type { BT_PLUGIN_TYPE_SO = 0, BT_PLUGIN_TYPE_PYTHON = 1, diff --git a/src/python-plugin-provider/python-plugin-provider.c b/src/python-plugin-provider/python-plugin-provider.c index b4bbff47..7ca264b4 100644 --- a/src/python-plugin-provider/python-plugin-provider.c +++ b/src/python-plugin-provider/python-plugin-provider.c @@ -26,6 +26,7 @@ #define BT_LOG_TAG "PLUGIN-PY" +#include "lib/lib-logging.h" #include "common/macros.h" #include "compat/compiler.h" #include