From f3bee1b15b1763498d78444bc61e13baf23e711b Mon Sep 17 00:00:00 2001 From: Sergiu Deitsch Date: Thu, 4 Jan 2024 22:06:27 +0100 Subject: [PATCH] fix: ensure export macro to be defined (#1031) --- src/glog/flags.h | 4 ++++ src/glog/log_severity.h | 4 ++++ src/glog/logging.h | 4 ++++ src/glog/raw_logging.h | 10 +++++++--- src/glog/vlog_is_on.h | 4 ++++ 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/glog/flags.h b/src/glog/flags.h index b53a381e1..8349639a6 100644 --- a/src/glog/flags.h +++ b/src/glog/flags.h @@ -41,6 +41,10 @@ # include "glog/export.h" #endif +#if !defined(GLOG_EXPORT) +# error was not included correctly. See the documention for how to consume the library. +#endif + #include "glog/platform.h" #include "glog/types.h" diff --git a/src/glog/log_severity.h b/src/glog/log_severity.h index a0296f2ec..ad588161b 100644 --- a/src/glog/log_severity.h +++ b/src/glog/log_severity.h @@ -34,6 +34,10 @@ # include "glog/export.h" #endif +#if !defined(GLOG_EXPORT) +# error was not included correctly. See the documention for how to consume the library. +#endif + namespace google { // The recommended semantics of the log levels are as follows: diff --git a/src/glog/logging.h b/src/glog/logging.h index 169488b50..30f313b53 100644 --- a/src/glog/logging.h +++ b/src/glog/logging.h @@ -56,6 +56,10 @@ # include "glog/export.h" #endif +#if !defined(GLOG_EXPORT) +# error was not included correctly. See the documention for how to consume the library. +#endif + #include "glog/flags.h" #include "glog/platform.h" #include "glog/types.h" diff --git a/src/glog/raw_logging.h b/src/glog/raw_logging.h index f96545258..195a1b9c7 100644 --- a/src/glog/raw_logging.h +++ b/src/glog/raw_logging.h @@ -36,13 +36,17 @@ #ifndef GLOG_RAW_LOGGING_H #define GLOG_RAW_LOGGING_H -#include "glog/log_severity.h" -#include "glog/vlog_is_on.h" - #if defined(GLOG_USE_GLOG_EXPORT) # include "glog/export.h" #endif +#if !defined(GLOG_EXPORT) +# error was not included correctly. See the documention for how to consume the library. +#endif + +#include "glog/log_severity.h" +#include "glog/vlog_is_on.h" + namespace google { // This is similar to LOG(severity) << format... and VLOG(level) << format.., diff --git a/src/glog/vlog_is_on.h b/src/glog/vlog_is_on.h index c183c55d4..f94b0fb8f 100644 --- a/src/glog/vlog_is_on.h +++ b/src/glog/vlog_is_on.h @@ -67,6 +67,10 @@ # include "glog/export.h" #endif +#if !defined(GLOG_EXPORT) +# error was not included correctly. See the documention for how to consume the library. +#endif + #include "glog/flags.h" #include "glog/types.h"