diff options
| author | Matthieu Darbois <mayeut@users.noreply.github.com> | 2016-09-06 00:49:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-06 00:49:53 +0200 |
| commit | 9f24b078c7193e886f6cfb329d3469eb1facf68d (patch) | |
| tree | be5852416e4793855d599245dc69a4bee14de9ce /src/lib/openjp2/opj_includes.h | |
| parent | 51155950eb3320a49835bb05d7867240d4d0cccc (diff) | |
Change 'restrict' define to 'OPJ_RESTRICT' (#816)
Visual Studio 2015 does not pass regression tests with `__restrict` so kept disabled for MSVC.
Need to check proper usage of OPJ_RESTRICT (if correct then there’s
probably a bug in vc14)
Closes #661
Diffstat (limited to 'src/lib/openjp2/opj_includes.h')
| -rw-r--r-- | src/lib/openjp2/opj_includes.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/lib/openjp2/opj_includes.h b/src/lib/openjp2/opj_includes.h index 58a5a9a9..60b7316d 100644 --- a/src/lib/openjp2/opj_includes.h +++ b/src/lib/openjp2/opj_includes.h @@ -103,12 +103,21 @@ */ /* Are restricted pointers available? (C99) */ -#if (__STDC_VERSION__ != 199901L) +#if (__STDC_VERSION__ >= 199901L) + #define OPJ_RESTRICT restrict +#else /* Not a C99 compiler */ - #ifdef __GNUC__ - #define restrict __restrict__ + #if defined(__GNUC__) + #define OPJ_RESTRICT __restrict__ + +/* + vc14 (2015) outputs wrong results. + Need to check OPJ_RESTRICT usage (or a bug in vc14) + #elif defined(_MSC_VER) && (_MSC_VER >= 1400) + #define OPJ_RESTRICT __restrict +*/ #else - #define restrict /* restrict */ + #define OPJ_RESTRICT /* restrict */ #endif #endif |
