From a1cee78876e72f9d8af1d7fc82919fe95627e84f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 12 Jan 2017 18:17:58 +0000 Subject: [PATCH] ECC-409: GNU Hurd support --- src/grib_api_internal.h | 12 ++++++++---- tools/grib_tools.h | 4 ++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/grib_api_internal.h b/src/grib_api_internal.h index e2d1846de..e5dfa4f63 100644 --- a/src/grib_api_internal.h +++ b/src/grib_api_internal.h @@ -171,12 +171,16 @@ extern "C" { #define DebugAssert(a) #endif -/* Compile time assertion - Thanks to Ralf Holly */ -#define COMPILE_TIME_ASSERT(e) \ +#ifdef __gnu_hurd__ + #define COMPILE_TIME_ASSERT(condition) \ + extern int compile_time_assert[!!(condition) - 1] +#else + /* Compile time assertion - Thanks to Ralf Holly */ + #define COMPILE_TIME_ASSERT(condition) \ do { \ - enum { assert_static__ = 1/(e) }; \ + enum { assert_static__ = 1/(condition) }; \ } while (0) - +#endif #ifndef NDEBUG #define DebugAssertAccess(array, index, size) \ diff --git a/tools/grib_tools.h b/tools/grib_tools.h index 90247a054..09f4f2e37 100644 --- a/tools/grib_tools.h +++ b/tools/grib_tools.h @@ -8,6 +8,10 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ +#ifdef __gnu_hurd__ + #define _FILE_OFFSET_BITS 64 /* 64-bit offsets off_t not the default on Hurd/i386 */ +#endif + #include "grib_api_internal.h" #include #ifndef ECCODES_ON_WINDOWS