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