Fixing FreeBSD compiler error.

This commit is contained in:
Robin Sommer 2012-07-25 13:58:23 -07:00
parent 7e228f1d6b
commit a33e9a6941
2 changed files with 10 additions and 8 deletions

View file

@ -3,16 +3,17 @@
// This is experimental code that is not yet ready for production usage. // This is experimental code that is not yet ready for production usage.
// //
#include "config.h" #include "config.h"
#ifdef USE_ELASTICSEARCH #ifdef USE_ELASTICSEARCH
#include "util.h" // Needs to come first for stdint.h
#include <string> #include <string>
#include <errno.h> #include <errno.h>
#include "util.h"
#include "BroString.h" #include "BroString.h"
#include "NetVar.h" #include "NetVar.h"
#include "threading/SerialTypes.h" #include "threading/SerialTypes.h"

View file

@ -3,6 +3,13 @@
#ifndef util_h #ifndef util_h
#define 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 <inttypes.h>
#include <stdint.h>
#include <string> #include <string>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -10,12 +17,6 @@
#include <stdarg.h> #include <stdarg.h>
#include "config.h" #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 <inttypes.h>
#if __STDC__ #if __STDC__
#define myattribute __attribute__ #define myattribute __attribute__
#else #else