From a33e9a69417a1ae4a8e54d1bc929967d4cd1f0df Mon Sep 17 00:00:00 2001 From: Robin Sommer Date: Wed, 25 Jul 2012 13:58:23 -0700 Subject: [PATCH] Fixing FreeBSD compiler error. --- src/logging/writers/ElasticSearch.cc | 5 +++-- src/util.h | 13 +++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/logging/writers/ElasticSearch.cc b/src/logging/writers/ElasticSearch.cc index b7edcf6aa6..2da79ed7b9 100644 --- a/src/logging/writers/ElasticSearch.cc +++ b/src/logging/writers/ElasticSearch.cc @@ -3,16 +3,17 @@ // This is experimental code that is not yet ready for production usage. // + #include "config.h" #ifdef USE_ELASTICSEARCH +#include "util.h" // Needs to come first for stdint.h + #include #include -#include "util.h" #include "BroString.h" - #include "NetVar.h" #include "threading/SerialTypes.h" diff --git a/src/util.h b/src/util.h index 048ec384e3..5d1bdf188a 100644 --- a/src/util.h +++ b/src/util.h @@ -3,6 +3,13 @@ #ifndef util_h #define util_h +// Expose C99 functionality from inttypes.h, which would otherwise not be +// available in C++. +#define __STDC_FORMAT_MACROS +#define __STDC_LIMIT_MACROS +#include +#include + #include #include #include @@ -10,12 +17,6 @@ #include #include "config.h" -// Expose C99 functionality from inttypes.h, which would otherwise not be -// available in C++. -#define __STDC_FORMAT_MACROS -#define __STDC_LIMIT_MACROS -#include - #if __STDC__ #define myattribute __attribute__ #else