Merge branch 'master' of https://github.com/uclouvain/openjpeg into tier1_optimizatio...
[openjpeg.git] / src / lib / openjp2 / opj_includes.h
index e835fae47eac9e0ade48275fcd55819a3ac5f7c4..66323e946806f1b7ba1c2858d7540b665e49a2ea 100644 (file)
 */
 
 /* 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