Skip to content

Commit

Permalink
disable alias tag for msvc
Browse files Browse the repository at this point in the history
It appears MSVC does not handle the restrict keyword properly

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
  • Loading branch information
kdt3rd committed Oct 5, 2024
1 parent 621f2f8 commit 0839a4b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/lib/OpenEXRCore/internal_huf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1164,10 +1164,13 @@ FastHufDecoder_buildTables (
return EXR_ERR_SUCCESS;
}

#ifdef __cplusplus
#ifndef __cplusplus
# ifndef _MSC_VER
# define NO_ALIAS restrict
# endif
#endif
#ifndef NO_ALIAS
# define NO_ALIAS
#else
# define NO_ALIAS restrict
#endif

static inline void
Expand Down
10 changes: 7 additions & 3 deletions src/lib/OpenEXRCore/internal_piz.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,14 @@ forwardLutFromBitmap (const uint8_t* bitmap, uint16_t* lut)
return k - 1;
}

#ifdef __cplusplus
#ifndef __cplusplus
// msvc does not seem to properly enable restrict in C compiling. /sigh
# ifndef _MSC_VER
# define NO_ALIAS restrict
# endif
#endif
#ifndef NO_ALIAS
# define NO_ALIAS
#else
# define NO_ALIAS restrict
#endif

static inline uint16_t
Expand Down

0 comments on commit 0839a4b

Please sign in to comment.