diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e33e6c..8f6812d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ set (SQUASH_SOVERSION_CURRENT ${SQUASH_VERSION_MAJOR}) set (SQUASH_SOVERSION_REVISION ${SQUASH_VERSION_MINOR}) set (SQUASH_SOVERSION_AGE ${SQUASH_VERSION_REVISION}) -cmake_minimum_required (VERSION 2.8.7) +cmake_minimum_required (VERSION 2.8.6) if (CMAKE_BUILD_TYPE STREQUAL "") set (CMAKE_BUILD_TYPE "Debug") diff --git a/plugins/crush/crush.c b/plugins/crush/crush.c index 022c512..acfd01b 100644 --- a/plugins/crush/crush.c +++ b/plugins/crush/crush.c @@ -59,10 +59,26 @@ # include #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) # include +#elif defined(__sun) || defined(sun) +# include #else # include #endif +#if !defined(LITTLE_ENDIAN) +# define LITTLE_ENDIAN 4321 +#endif +#if !defined(BIG_ENDIAN) +# define BIG_ENDIAN 1234 +#endif +#if !defined(BYTE_ORDER) +# if defined(_BIG_ENDIAN) +# define BYTE_ORDER BIG_ENDIAN +# else +# define BYTE_ORDER LITTLE_ENDIAN +# endif +#endif + #if defined(__GNUC__) # define ENDIAN_BSWAP16(v) __builtin_bswap16(v) # define ENDIAN_BSWAP32(v) __builtin_bswap32(v) diff --git a/plugins/ncompress/compress.c b/plugins/ncompress/compress.c index 6acd0d8..8e89c1f 100644 --- a/plugins/ncompress/compress.c +++ b/plugins/ncompress/compress.c @@ -39,34 +39,28 @@ #define INIT_BITS 9 /* initial number of bits/code */ -#if !defined(BYTEORDER) && defined(_WIN32) +#if defined(_WIN32) # define BYTEORDER 4321 -#endif - -#ifndef BYTEORDER -# if !defined(BYTE_ORDER) -# if defined(__APPLE__) -# include -# elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragoFly__) -# include +#elif defined(sun) || defined(__sun) +# include +# if defined(_BIG_ENDIAN) +# define BYTEORDER 1234 # else -# include +# define BYTEORDER 4321 # endif -# endif -# if defined(BYTE_ORDER) -# if BYTE_ORDER == LITTLE_ENDIAN -# define BYTEORDER 4321 +#else +# if defined(__APPLE__) +# include +# elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) +# include # else -# define BYTEORDER 1234 +# include # endif -# else -# ifdef _MSC_VER -# pragma message("Unable to figure out byteorder, defaulting to slow byte swapping") +# if (BYTE_ORDER == BIG_ENDIAN) +# define BYTEORDER 1234 # else -# warning Unable to figure out byteorder, defaulting to slow byte swapping +# define BYTEORDER 4321 # endif -# define BYTEORDER 0000 -# endif #endif #ifndef NOALLIGN diff --git a/plugins/snappy/snappy-stubs-public.h.in b/plugins/snappy/snappy-stubs-public.h.in index f1f5889..fe8d459 100644 --- a/plugins/snappy/snappy-stubs-public.h.in +++ b/plugins/snappy/snappy-stubs-public.h.in @@ -58,7 +58,13 @@ #define SNAPPY_VERSION \ ((SNAPPY_MAJOR << 16) | (SNAPPY_MINOR << 8) | SNAPPY_PATCHLEVEL) -#if !defined(_WIN32) +#if defined(_WIN32) +#elif defined(sun) || defined(__sun) +# include +# if defined(_BIG_ENDIAN) +# define WORDS_BIGENDIAN +# endif +#else # if defined(__APPLE__) # include # elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) @@ -66,7 +72,7 @@ # else # include # endif -# if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && (BYTE_ORDER == BIG_ENDIAN) +# if (BYTE_ORDER == BIG_ENDIAN) # define WORDS_BIGENDIAN # endif #endif diff --git a/squash/charset.c b/squash/charset.c index 3fc0572..7311c90 100644 --- a/squash/charset.c +++ b/squash/charset.c @@ -27,6 +27,7 @@ #include "internal.h" #include +#include #include #include #include diff --git a/squash/codec.c b/squash/codec.c index f0617dd..daec08a 100644 --- a/squash/codec.c +++ b/squash/codec.c @@ -24,6 +24,7 @@ * Evan Nemerson */ +#define _XOPEN_SOURCE 600 #define _POSIX_C_SOURCE 200809L #include diff --git a/squash/internal.h b/squash/internal.h index 36b0874..2f8a34d 100644 --- a/squash/internal.h +++ b/squash/internal.h @@ -35,6 +35,11 @@ # error "You must include internal.h instead of squash.h" #endif +/* Solaris freaks out if you try to use older standards with C99. */ +#if defined(__sun) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define _XOPEN_SOURCE 600 +#endif + #ifndef SQUASH_FILE_BUF_SIZE # define SQUASH_FILE_BUF_SIZE ((size_t) (1024 * 1024)) #endif diff --git a/squash/license.c b/squash/license.c index c50ed88..2bc3b65 100644 --- a/squash/license.c +++ b/squash/license.c @@ -26,6 +26,7 @@ #include #include +#include /** * @def SQUASH_LICENSE_UNKNOWN diff --git a/squash/squash.h b/squash/squash.h index 68523fd..a071e42 100644 --- a/squash/squash.h +++ b/squash/squash.h @@ -50,7 +50,7 @@ # define SQUASH_END_DECLS #endif -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus) # define SQUASH_ARRAY_PARAM(name) name #else # define SQUASH_ARRAY_PARAM(name) diff --git a/tests/munit b/tests/munit index 56012f6..a0639ea 160000 --- a/tests/munit +++ b/tests/munit @@ -1 +1 @@ -Subproject commit 56012f668357b489d280331659155010c6a1e304 +Subproject commit a0639ea966ae5231574e9c585d1f35833e996917