mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 14:05:33 +00:00
[#625,!485] Conditional explicit initialization done.
This commit is contained in:
committed by
Tomek Mrugalski
parent
bb9d894b69
commit
3abda71b1d
@@ -1030,6 +1030,15 @@ AC_MSG_RESULT([$LOG4CPLUS_VERSION])
|
||||
CPPFLAGS=$CPPFLAGS_SAVED
|
||||
LIBS=$LIBS_SAVED
|
||||
|
||||
AC_MSG_CHECKING([log4cplus explicit initialization (log4cplus/initializer.h)])
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([#include <log4cplus/initializer.h>],
|
||||
[log4cplus::Initializer initializer;]
|
||||
)],
|
||||
[AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(LOG4CPLUS_INITIALIZER_H, [1], [Explicit initialization of log4cplus possible])],
|
||||
[AC_MSG_RESULT(no)])
|
||||
|
||||
#
|
||||
# Configure Boost header path
|
||||
#
|
||||
|
@@ -24,13 +24,20 @@
|
||||
#include <log/message_types.h>
|
||||
#include <log/interprocess/interprocess_sync_null.h>
|
||||
|
||||
#include <log4cplus/initializer.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
// Older log4cplus versions (1.2.0) don't have the initializer.h header that
|
||||
// would allow explicit initialization. Newer versions (2.0.4 for sure, possibly
|
||||
// older as well) have it and it's recommended to use it. We detect whether
|
||||
// it's present or not and do explicit initalization if possible.
|
||||
#ifdef LOG4CPLUS_INITIALIZER_H
|
||||
#include <log4cplus/initializer.h>
|
||||
namespace {
|
||||
|
||||
log4cplus::Initializer initializer;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
// Logger used for logging messages within the logging code itself.
|
||||
isc::log::Logger logger("log");
|
||||
|
Reference in New Issue
Block a user