Module: check_mk
Branch: master
Commit: ce243c61f1db5e966cb99f3adaff9961d8c77c51
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ce243c61f1db5e…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue Nov 24 15:57:54 2015 +0100
Make iwyu happy for CMC compilation, too.
---
livestatus/src/HostFileColumn.cc | 3 ++-
livestatus/src/LogEntry.h | 4 +++-
livestatus/src/Logfile.cc | 3 ++-
livestatus/src/TableLog.cc | 5 ++++-
livestatus/src/TableStateHistory.cc | 3 ++-
livestatus/src/nagios.h | 15 +++++++--------
6 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/livestatus/src/HostFileColumn.cc b/livestatus/src/HostFileColumn.cc
index 6a08c1e..abd5165 100644
--- a/livestatus/src/HostFileColumn.cc
+++ b/livestatus/src/HostFileColumn.cc
@@ -28,10 +28,11 @@
#include <stdlib.h>
#include <unistd.h>
#include "logger.h"
-#include "nagios.h"
#ifdef CMC
#include "Host.h"
+#else
+#include "nagios.h"
#endif
using std::string;
diff --git a/livestatus/src/LogEntry.h b/livestatus/src/LogEntry.h
index beac181..99a6459 100644
--- a/livestatus/src/LogEntry.h
+++ b/livestatus/src/LogEntry.h
@@ -28,7 +28,9 @@
#include "config.h" // IWYU pragma: keep
#include <time.h>
#include "nagios.h"
-
+#ifdef CMC
+struct command;
+#endif
#define LOGCLASS_INFO 0 // all messages not in any other class
#define LOGCLASS_ALERT 1 // alerts: the change service/host state
diff --git a/livestatus/src/Logfile.cc b/livestatus/src/Logfile.cc
index b6ea0b2..5ac21f9 100644
--- a/livestatus/src/Logfile.cc
+++ b/livestatus/src/Logfile.cc
@@ -37,7 +37,8 @@
#include "logger.h"
#ifdef CMC
-#include "Core.h"
+#include "cmc.h"
+struct Core;
extern Core *g_core;
#endif
diff --git a/livestatus/src/TableLog.cc b/livestatus/src/TableLog.cc
index bcede94..de47604 100644
--- a/livestatus/src/TableLog.cc
+++ b/livestatus/src/TableLog.cc
@@ -40,9 +40,12 @@
#include "TableContacts.h"
#include "TableHosts.h"
#include "TableServices.h"
-#include "auth.h"
#include "tables.h"
+#ifndef CMC
+#include "auth.h"
+#endif
+
using mk::lock_guard;
using mk::mutex;
using std::string;
diff --git a/livestatus/src/TableStateHistory.cc b/livestatus/src/TableStateHistory.cc
index b273724..12a6bc4 100644
--- a/livestatus/src/TableStateHistory.cc
+++ b/livestatus/src/TableStateHistory.cc
@@ -48,7 +48,6 @@
#include "Store.h"
#include "TableHosts.h"
#include "TableServices.h"
-#include "auth.h"
#include "logger.h"
#include "tables.h"
@@ -56,6 +55,8 @@
#include "Host.h"
#include "Service.h"
#include "Timeperiod.h"
+#else
+#include "auth.h"
#endif
using mk::lock_guard;
diff --git a/livestatus/src/nagios.h b/livestatus/src/nagios.h
index 20e92a1..188ac73 100644
--- a/livestatus/src/nagios.h
+++ b/livestatus/src/nagios.h
@@ -27,12 +27,12 @@
#include "config.h" // IWYU pragma: keep
+// IWYU pragma: begin_exports
#ifdef CMC
-#include "../cmc.h"
+ #include "cmc.h"
#else
- // IWYU pragma: begin_exports
- #define NSCORE
- #ifdef NAGIOS4
+ #define NSCORE
+ #ifdef NAGIOS4
#include "nagios4/common.h"
#include "nagios4/objects.h"
#include "nagios4/nagios.h"
@@ -44,7 +44,7 @@
#include "nagios4/macros.h"
#include "nagios4/downtime.h"
#include "nagios4/logging.h"
- #else
+ #else
#include "nagios/common.h"
#include "nagios/objects.h"
#include "nagios/nagios.h"
@@ -55,8 +55,7 @@
#include "nagios/nebcallbacks.h"
#include "nagios/macros.h"
#include "nagios/downtime.h"
- #endif // NAGIOS4
- // IWYU pragma: end_exports
+ #endif // NAGIOS4
#endif // CMC
+// IWYU pragma: end_exports
#endif // nagios_h
-