From c30d64a2611c567e6c034e9aaeede406963522b0 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 26 Feb 2015 09:02:45 +0100 Subject: [PATCH] Build fix for Windows refs #8486 --- lib/livestatus/CMakeLists.txt | 1 + lib/livestatus/aggregator.hpp | 3 +- lib/livestatus/andfilter.hpp | 2 +- lib/livestatus/attributefilter.hpp | 2 +- lib/livestatus/avgaggregator.hpp | 2 +- lib/livestatus/column.hpp | 4 ++- lib/livestatus/combinerfilter.hpp | 2 +- lib/livestatus/commandstable.hpp | 2 +- lib/livestatus/commentstable.hpp | 2 +- lib/livestatus/contactgroupstable.hpp | 2 +- lib/livestatus/contactstable.hpp | 2 +- lib/livestatus/countaggregator.hpp | 2 +- lib/livestatus/downtimestable.hpp | 2 +- lib/livestatus/endpointstable.hpp | 2 +- lib/livestatus/filter.hpp | 3 +- lib/livestatus/historytable.hpp | 2 +- lib/livestatus/hostgroupstable.hpp | 2 +- lib/livestatus/hoststable.hpp | 2 +- lib/livestatus/i2-livestatus.hpp | 37 +++++++++++++++++++++++++ lib/livestatus/invavgaggregator.hpp | 2 +- lib/livestatus/invsumaggregator.hpp | 2 +- lib/livestatus/livestatuslistener.hpp | 3 +- lib/livestatus/livestatuslogutility.hpp | 3 +- lib/livestatus/livestatusquery.hpp | 2 +- lib/livestatus/logtable.hpp | 2 +- lib/livestatus/maxaggregator.hpp | 2 +- lib/livestatus/minaggregator.hpp | 2 +- lib/livestatus/negatefilter.hpp | 2 +- lib/livestatus/orfilter.hpp | 2 +- lib/livestatus/servicegroupstable.hpp | 2 +- lib/livestatus/servicestable.hpp | 2 +- lib/livestatus/statehisttable.hpp | 2 +- lib/livestatus/statustable.hpp | 2 +- lib/livestatus/stdaggregator.hpp | 2 +- lib/livestatus/sumaggregator.hpp | 2 +- lib/livestatus/table.hpp | 2 +- lib/livestatus/timeperiodstable.hpp | 2 +- 37 files changed, 78 insertions(+), 36 deletions(-) create mode 100644 lib/livestatus/i2-livestatus.hpp diff --git a/lib/livestatus/CMakeLists.txt b/lib/livestatus/CMakeLists.txt index 84cfd2f8e..07a4ce8ea 100644 --- a/lib/livestatus/CMakeLists.txt +++ b/lib/livestatus/CMakeLists.txt @@ -44,6 +44,7 @@ target_link_libraries(livestatus ${Boost_LIBRARIES} base config icinga remote) set_target_properties ( livestatus PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2 + DEFINE_SYMBOL I2_LIVESTATUS_BUILD FOLDER Components ) diff --git a/lib/livestatus/aggregator.hpp b/lib/livestatus/aggregator.hpp index 1b1b7a8df..1e4f99f1f 100644 --- a/lib/livestatus/aggregator.hpp +++ b/lib/livestatus/aggregator.hpp @@ -20,6 +20,7 @@ #ifndef AGGREGATOR_H #define AGGREGATOR_H +#include "livestatus/i2-livestatus.hpp" #include "livestatus/table.hpp" #include "livestatus/filter.hpp" @@ -29,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class Aggregator : public Object +class I2_LIVESTATUS_API Aggregator : public Object { public: DECLARE_PTR_TYPEDEFS(Aggregator); diff --git a/lib/livestatus/andfilter.hpp b/lib/livestatus/andfilter.hpp index 36d4f34d6..04ec9b4c4 100644 --- a/lib/livestatus/andfilter.hpp +++ b/lib/livestatus/andfilter.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class AndFilter : public CombinerFilter +class I2_LIVESTATUS_API AndFilter : public CombinerFilter { public: DECLARE_PTR_TYPEDEFS(AndFilter); diff --git a/lib/livestatus/attributefilter.hpp b/lib/livestatus/attributefilter.hpp index 3a1dbd994..0676f8049 100644 --- a/lib/livestatus/attributefilter.hpp +++ b/lib/livestatus/attributefilter.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class AttributeFilter : public Filter +class I2_LIVESTATUS_API AttributeFilter : public Filter { public: DECLARE_PTR_TYPEDEFS(AttributeFilter); diff --git a/lib/livestatus/avgaggregator.hpp b/lib/livestatus/avgaggregator.hpp index fe3a3cdd7..66b645ea9 100644 --- a/lib/livestatus/avgaggregator.hpp +++ b/lib/livestatus/avgaggregator.hpp @@ -29,7 +29,7 @@ namespace icinga /** * @ingroup livestatus */ -class AvgAggregator : public Aggregator +class I2_LIVESTATUS_API AvgAggregator : public Aggregator { public: DECLARE_PTR_TYPEDEFS(AvgAggregator); diff --git a/lib/livestatus/column.hpp b/lib/livestatus/column.hpp index 74618dac1..0209586b2 100644 --- a/lib/livestatus/column.hpp +++ b/lib/livestatus/column.hpp @@ -20,6 +20,8 @@ #ifndef COLUMN_H #define COLUMN_H +#include "livestatus/i2-livestatus.hpp" +#include "livestatus/i2-livestatus.hpp" #include "base/value.hpp" #include @@ -34,7 +36,7 @@ enum LivestatusGroupByType { LivestatusGroupByServiceGroup }; -class Column +class I2_LIVESTATUS_API Column { public: typedef boost::function ValueAccessor; diff --git a/lib/livestatus/combinerfilter.hpp b/lib/livestatus/combinerfilter.hpp index 7a1d76e98..dfc308091 100644 --- a/lib/livestatus/combinerfilter.hpp +++ b/lib/livestatus/combinerfilter.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class CombinerFilter : public Filter +class I2_LIVESTATUS_API CombinerFilter : public Filter { public: DECLARE_PTR_TYPEDEFS(CombinerFilter); diff --git a/lib/livestatus/commandstable.hpp b/lib/livestatus/commandstable.hpp index 2c61d3123..8f3fc048e 100644 --- a/lib/livestatus/commandstable.hpp +++ b/lib/livestatus/commandstable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class CommandsTable : public Table +class I2_LIVESTATUS_API CommandsTable : public Table { public: DECLARE_PTR_TYPEDEFS(CommandsTable); diff --git a/lib/livestatus/commentstable.hpp b/lib/livestatus/commentstable.hpp index 307b043ae..7d03685a4 100644 --- a/lib/livestatus/commentstable.hpp +++ b/lib/livestatus/commentstable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class CommentsTable : public Table +class I2_LIVESTATUS_API CommentsTable : public Table { public: DECLARE_PTR_TYPEDEFS(CommentsTable); diff --git a/lib/livestatus/contactgroupstable.hpp b/lib/livestatus/contactgroupstable.hpp index 112b8e773..e0824f846 100644 --- a/lib/livestatus/contactgroupstable.hpp +++ b/lib/livestatus/contactgroupstable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class ContactGroupsTable : public Table +class I2_LIVESTATUS_API ContactGroupsTable : public Table { public: DECLARE_PTR_TYPEDEFS(ContactGroupsTable); diff --git a/lib/livestatus/contactstable.hpp b/lib/livestatus/contactstable.hpp index 2ff0799d6..aa9d894b5 100644 --- a/lib/livestatus/contactstable.hpp +++ b/lib/livestatus/contactstable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class ContactsTable : public Table +class I2_LIVESTATUS_API ContactsTable : public Table { public: DECLARE_PTR_TYPEDEFS(ContactsTable); diff --git a/lib/livestatus/countaggregator.hpp b/lib/livestatus/countaggregator.hpp index 5415144b7..1666c4fad 100644 --- a/lib/livestatus/countaggregator.hpp +++ b/lib/livestatus/countaggregator.hpp @@ -29,7 +29,7 @@ namespace icinga /** * @ingroup livestatus */ -class CountAggregator : public Aggregator +class I2_LIVESTATUS_API CountAggregator : public Aggregator { public: DECLARE_PTR_TYPEDEFS(CountAggregator); diff --git a/lib/livestatus/downtimestable.hpp b/lib/livestatus/downtimestable.hpp index fa78df9bc..a26180802 100644 --- a/lib/livestatus/downtimestable.hpp +++ b/lib/livestatus/downtimestable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class DowntimesTable : public Table +class I2_LIVESTATUS_API DowntimesTable : public Table { public: DECLARE_PTR_TYPEDEFS(DowntimesTable); diff --git a/lib/livestatus/endpointstable.hpp b/lib/livestatus/endpointstable.hpp index 71dbf3faf..9c7e88a82 100644 --- a/lib/livestatus/endpointstable.hpp +++ b/lib/livestatus/endpointstable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class EndpointsTable : public Table +class I2_LIVESTATUS_API EndpointsTable : public Table { public: DECLARE_PTR_TYPEDEFS(EndpointsTable); diff --git a/lib/livestatus/filter.hpp b/lib/livestatus/filter.hpp index 44dfe364f..07652770a 100644 --- a/lib/livestatus/filter.hpp +++ b/lib/livestatus/filter.hpp @@ -20,6 +20,7 @@ #ifndef FILTER_H #define FILTER_H +#include "livestatus/i2-livestatus.hpp" #include "livestatus/table.hpp" namespace icinga @@ -28,7 +29,7 @@ namespace icinga /** * @ingroup livestatus */ -class Filter : public Object +class I2_LIVESTATUS_API Filter : public Object { public: DECLARE_PTR_TYPEDEFS(Filter); diff --git a/lib/livestatus/historytable.hpp b/lib/livestatus/historytable.hpp index c31039fbf..11c6186f7 100644 --- a/lib/livestatus/historytable.hpp +++ b/lib/livestatus/historytable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class HistoryTable : public Table +class I2_LIVESTATUS_API HistoryTable : public Table { public: virtual void UpdateLogEntries(const Dictionary::Ptr& bag, int line_count, int lineno, const AddRowFunction& addRowFn); diff --git a/lib/livestatus/hostgroupstable.hpp b/lib/livestatus/hostgroupstable.hpp index 140a34bae..c4f7fd87c 100644 --- a/lib/livestatus/hostgroupstable.hpp +++ b/lib/livestatus/hostgroupstable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class HostGroupsTable : public Table +class I2_LIVESTATUS_API HostGroupsTable : public Table { public: DECLARE_PTR_TYPEDEFS(HostGroupsTable); diff --git a/lib/livestatus/hoststable.hpp b/lib/livestatus/hoststable.hpp index 8b6c61cda..89e2afc02 100644 --- a/lib/livestatus/hoststable.hpp +++ b/lib/livestatus/hoststable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class HostsTable : public Table +class I2_LIVESTATUS_API HostsTable : public Table { public: DECLARE_PTR_TYPEDEFS(HostsTable); diff --git a/lib/livestatus/i2-livestatus.hpp b/lib/livestatus/i2-livestatus.hpp new file mode 100644 index 000000000..1e2459460 --- /dev/null +++ b/lib/livestatus/i2-livestatus.hpp @@ -0,0 +1,37 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012-2015 Icinga Development Team (http://www.icinga.org) * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software Foundation * + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * + ******************************************************************************/ + +#ifndef I2LIVESTATUS_H +#define I2LIVESTATUS_H + +/** + * @defgroup icinga Livestatus + * + * The Livestatus library implements the Livestatus protocol for Icinga. + */ + +#include "base/i2-base.hpp" + +#ifdef I2_LIVESTATUS_BUILD +# define I2_LIVESTATUS_API I2_EXPORT +#else /* I2_LIVESTATUS_BUILD */ +# define I2_LIVESTATUS_API I2_IMPORT +#endif /* I2_LIVESTATUS_BUILD */ + +#endif /* I2LIVESTATUS_H */ diff --git a/lib/livestatus/invavgaggregator.hpp b/lib/livestatus/invavgaggregator.hpp index a5c1d5bb3..03b25b7dd 100644 --- a/lib/livestatus/invavgaggregator.hpp +++ b/lib/livestatus/invavgaggregator.hpp @@ -29,7 +29,7 @@ namespace icinga /** * @ingroup livestatus */ -class InvAvgAggregator : public Aggregator +class I2_LIVESTATUS_API InvAvgAggregator : public Aggregator { public: DECLARE_PTR_TYPEDEFS(InvAvgAggregator); diff --git a/lib/livestatus/invsumaggregator.hpp b/lib/livestatus/invsumaggregator.hpp index 7be39050e..8e962ee5b 100644 --- a/lib/livestatus/invsumaggregator.hpp +++ b/lib/livestatus/invsumaggregator.hpp @@ -29,7 +29,7 @@ namespace icinga /** * @ingroup livestatus */ -class InvSumAggregator : public Aggregator +class I2_LIVESTATUS_API InvSumAggregator : public Aggregator { public: DECLARE_PTR_TYPEDEFS(InvSumAggregator); diff --git a/lib/livestatus/livestatuslistener.hpp b/lib/livestatus/livestatuslistener.hpp index cc765a3c0..334e34b58 100644 --- a/lib/livestatus/livestatuslistener.hpp +++ b/lib/livestatus/livestatuslistener.hpp @@ -20,6 +20,7 @@ #ifndef LIVESTATUSLISTENER_H #define LIVESTATUSLISTENER_H +#include "livestatus/i2-livestatus.hpp" #include "livestatus/livestatuslistener.thpp" #include "livestatus/livestatusquery.hpp" #include "base/socket.hpp" @@ -33,7 +34,7 @@ namespace icinga /** * @ingroup livestatus */ -class LivestatusListener : public ObjectImpl +class I2_LIVESTATUS_API LivestatusListener : public ObjectImpl { public: DECLARE_OBJECT(LivestatusListener); diff --git a/lib/livestatus/livestatuslogutility.hpp b/lib/livestatus/livestatuslogutility.hpp index 1d71da24a..863da2d6d 100644 --- a/lib/livestatus/livestatuslogutility.hpp +++ b/lib/livestatus/livestatuslogutility.hpp @@ -60,9 +60,8 @@ enum LogEntryClass { /** * @ingroup livestatus */ -class LivestatusLogUtility +class I2_LIVESTATUS_API LivestatusLogUtility { - public: static void CreateLogIndex(const String& path, std::map& index); static void CreateLogIndexFileHandler(const String& path, std::map& index); diff --git a/lib/livestatus/livestatusquery.hpp b/lib/livestatus/livestatusquery.hpp index 893d13abb..24c0ab302 100644 --- a/lib/livestatus/livestatusquery.hpp +++ b/lib/livestatus/livestatusquery.hpp @@ -55,7 +55,7 @@ struct LivestatusScriptFrame /** * @ingroup livestatus */ -class LivestatusQuery : public Object +class I2_LIVESTATUS_API LivestatusQuery : public Object { public: DECLARE_PTR_TYPEDEFS(LivestatusQuery); diff --git a/lib/livestatus/logtable.hpp b/lib/livestatus/logtable.hpp index b57dbb9ba..d341dfca6 100644 --- a/lib/livestatus/logtable.hpp +++ b/lib/livestatus/logtable.hpp @@ -31,7 +31,7 @@ namespace icinga /** * @ingroup livestatus */ -class LogTable : public HistoryTable +class I2_LIVESTATUS_API LogTable : public HistoryTable { public: DECLARE_PTR_TYPEDEFS(LogTable); diff --git a/lib/livestatus/maxaggregator.hpp b/lib/livestatus/maxaggregator.hpp index fcbb32809..eb3b405a2 100644 --- a/lib/livestatus/maxaggregator.hpp +++ b/lib/livestatus/maxaggregator.hpp @@ -29,7 +29,7 @@ namespace icinga /** * @ingroup livestatus */ -class MaxAggregator : public Aggregator +class I2_LIVESTATUS_API MaxAggregator : public Aggregator { public: DECLARE_PTR_TYPEDEFS(MaxAggregator); diff --git a/lib/livestatus/minaggregator.hpp b/lib/livestatus/minaggregator.hpp index 823e4bd0c..895fce60f 100644 --- a/lib/livestatus/minaggregator.hpp +++ b/lib/livestatus/minaggregator.hpp @@ -29,7 +29,7 @@ namespace icinga /** * @ingroup livestatus */ -class MinAggregator : public Aggregator +class I2_LIVESTATUS_API MinAggregator : public Aggregator { public: DECLARE_PTR_TYPEDEFS(MinAggregator); diff --git a/lib/livestatus/negatefilter.hpp b/lib/livestatus/negatefilter.hpp index 2e6abf6c1..88efd4da0 100644 --- a/lib/livestatus/negatefilter.hpp +++ b/lib/livestatus/negatefilter.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class NegateFilter : public Filter +class I2_LIVESTATUS_API NegateFilter : public Filter { public: DECLARE_PTR_TYPEDEFS(NegateFilter); diff --git a/lib/livestatus/orfilter.hpp b/lib/livestatus/orfilter.hpp index 7c8e6c510..0dc536ebc 100644 --- a/lib/livestatus/orfilter.hpp +++ b/lib/livestatus/orfilter.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class OrFilter : public CombinerFilter +class I2_LIVESTATUS_API OrFilter : public CombinerFilter { public: DECLARE_PTR_TYPEDEFS(OrFilter); diff --git a/lib/livestatus/servicegroupstable.hpp b/lib/livestatus/servicegroupstable.hpp index 729683d33..da025bb3b 100644 --- a/lib/livestatus/servicegroupstable.hpp +++ b/lib/livestatus/servicegroupstable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class ServiceGroupsTable : public Table +class I2_LIVESTATUS_API ServiceGroupsTable : public Table { public: DECLARE_PTR_TYPEDEFS(ServiceGroupsTable); diff --git a/lib/livestatus/servicestable.hpp b/lib/livestatus/servicestable.hpp index f0f99ca79..8e17613a2 100644 --- a/lib/livestatus/servicestable.hpp +++ b/lib/livestatus/servicestable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class ServicesTable : public Table +class I2_LIVESTATUS_API ServicesTable : public Table { public: DECLARE_PTR_TYPEDEFS(ServicesTable); diff --git a/lib/livestatus/statehisttable.hpp b/lib/livestatus/statehisttable.hpp index b2211a908..5e91ca208 100644 --- a/lib/livestatus/statehisttable.hpp +++ b/lib/livestatus/statehisttable.hpp @@ -32,7 +32,7 @@ namespace icinga /** * @ingroup livestatus */ -class StateHistTable : public HistoryTable +class I2_LIVESTATUS_API StateHistTable : public HistoryTable { public: DECLARE_PTR_TYPEDEFS(StateHistTable); diff --git a/lib/livestatus/statustable.hpp b/lib/livestatus/statustable.hpp index a8d50261a..5f6b7a637 100644 --- a/lib/livestatus/statustable.hpp +++ b/lib/livestatus/statustable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class StatusTable : public Table +class I2_LIVESTATUS_API StatusTable : public Table { public: DECLARE_PTR_TYPEDEFS(StatusTable); diff --git a/lib/livestatus/stdaggregator.hpp b/lib/livestatus/stdaggregator.hpp index 6725a665a..ae76c96f5 100644 --- a/lib/livestatus/stdaggregator.hpp +++ b/lib/livestatus/stdaggregator.hpp @@ -29,7 +29,7 @@ namespace icinga /** * @ingroup livestatus */ -class StdAggregator : public Aggregator +class I2_LIVESTATUS_API StdAggregator : public Aggregator { public: DECLARE_PTR_TYPEDEFS(StdAggregator); diff --git a/lib/livestatus/sumaggregator.hpp b/lib/livestatus/sumaggregator.hpp index 528a2d70b..8dd0adb4d 100644 --- a/lib/livestatus/sumaggregator.hpp +++ b/lib/livestatus/sumaggregator.hpp @@ -29,7 +29,7 @@ namespace icinga /** * @ingroup livestatus */ -class SumAggregator : public Aggregator +class I2_LIVESTATUS_API SumAggregator : public Aggregator { public: DECLARE_PTR_TYPEDEFS(SumAggregator); diff --git a/lib/livestatus/table.hpp b/lib/livestatus/table.hpp index e27ed0201..ee86bbd84 100644 --- a/lib/livestatus/table.hpp +++ b/lib/livestatus/table.hpp @@ -43,7 +43,7 @@ class Filter; /** * @ingroup livestatus */ -class Table : public Object +class I2_LIVESTATUS_API Table : public Object { public: DECLARE_PTR_TYPEDEFS(Table); diff --git a/lib/livestatus/timeperiodstable.hpp b/lib/livestatus/timeperiodstable.hpp index ce3a0d8b5..0220e26d9 100644 --- a/lib/livestatus/timeperiodstable.hpp +++ b/lib/livestatus/timeperiodstable.hpp @@ -30,7 +30,7 @@ namespace icinga /** * @ingroup livestatus */ -class TimePeriodsTable : public Table +class I2_LIVESTATUS_API TimePeriodsTable : public Table { public: DECLARE_PTR_TYPEDEFS(TimePeriodsTable); -- 2.40.0