From 5926e9bd4993d6861906d4b812b97154baa117f6 Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Fri, 15 Jun 2018 06:07:14 +0000 Subject: [PATCH] fix endian detection on freebsd --- common.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common.h b/common.h index 1432a53..1782215 100644 --- a/common.h +++ b/common.h @@ -28,7 +28,7 @@ //#include //Provides declarations for tcp header //#include //#include //Provides declarations for ip header -#include +//#include #include #include //#include @@ -62,6 +62,7 @@ using namespace std; #if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || \ + defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ || \ defined(__BIG_ENDIAN__) || \ defined(__ARMEB__) || \ defined(__THUMBEB__) || \ @@ -72,6 +73,7 @@ using namespace std; #if defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN || \ + defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ || \ defined(__LITTLE_ENDIAN__) || \ defined(__ARMEL__) || \ defined(__THUMBEL__) || \ @@ -89,6 +91,7 @@ using namespace std; #error "endian detection failed" #endif + typedef unsigned long long u64_t; //this works on most platform,avoid using the PRId64 typedef long long i64_t;