diff options
author | Eugene Kliuchnikov <eustas@google.com> | 2018-05-03 11:16:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-03 11:16:21 +0200 |
commit | f5ed35d0658eed11787aeea1262d4370f2e9a5de (patch) | |
tree | 8d0ee2b7a8413602a5886f4bb53eaf51f237ed0b /c/include | |
parent | f94cd51b5c91eb8cf1204859b1c784b14d6a647a (diff) | |
download | brotli-f5ed35d0658eed11787aeea1262d4370f2e9a5de.zip brotli-f5ed35d0658eed11787aeea1262d4370f2e9a5de.tar.gz brotli-f5ed35d0658eed11787aeea1262d4370f2e9a5de.tar.bz2 |
Update (#664)
* Update
* fix ifdef style
* get back to fine-compiler-version-based-macros (use Hedley)
* fix q=0 histogram collection for very long copy/insert commands
Diffstat (limited to 'c/include')
-rw-r--r-- | c/include/brotli/port.h | 30 | ||||
-rw-r--r-- | c/include/brotli/types.h | 7 |
2 files changed, 7 insertions, 30 deletions
diff --git a/c/include/brotli/port.h b/c/include/brotli/port.h index d49fa6a..e5ac4ba 100644 --- a/c/include/brotli/port.h +++ b/c/include/brotli/port.h @@ -4,34 +4,18 @@ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT */ -/* Macros for compiler / platform specific features and build options. - - Build options are: - * BROTLI_BUILD_MODERN_COMPILER forces to use modern compilers built-ins, - features and attributes - */ +/* Macros for compiler / platform specific API declarations. */ #ifndef BROTLI_COMMON_PORT_H_ #define BROTLI_COMMON_PORT_H_ -#if defined(__GNUC__) && defined(__GNUC_MINOR__) -#define BROTLI_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) -#else -#define BROTLI_GCC_VERSION 0 -#endif - -#if defined(__ICC) -#define BROTLI_ICC_VERSION __ICC -#else -#define BROTLI_ICC_VERSION 0 -#endif - -#if defined(BROTLI_BUILD_MODERN_COMPILER) -#define BROTLI_MODERN_COMPILER 1 -#elif BROTLI_GCC_VERSION >= 304 || BROTLI_ICC_VERSION >= 1600 -#define BROTLI_MODERN_COMPILER 1 +/* NB: borrowed from github.com.nemequ/hedley. */ +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ + !defined(__STDC_NO_VLA__) && !defined(__cplusplus) && \ + !defined(__PGI) && !defined(__PGIC__) && !defined(__TINYC__) +#define BROTLI_ARRAY_PARAM(name) (name) #else -#define BROTLI_MODERN_COMPILER 0 +#define BROTLI_ARRAY_PARAM(name) #endif #if defined(BROTLI_SHARED_COMPILATION) && defined(_WIN32) diff --git a/c/include/brotli/types.h b/c/include/brotli/types.h index fcb2710..eff1a3c 100644 --- a/c/include/brotli/types.h +++ b/c/include/brotli/types.h @@ -80,11 +80,4 @@ typedef void* (*brotli_alloc_func)(void* opaque, size_t size); */ typedef void (*brotli_free_func)(void* opaque, void* address); -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ - !defined(__cplusplus) && !defined(__PGI) -#define BROTLI_ARRAY_PARAM(L) L -#else -#define BROTLI_ARRAY_PARAM(L) -#endif - #endif /* BROTLI_COMMON_TYPES_H_ */ |