33 #ifndef OPJ_INCLUDES_H
34 #define OPJ_INCLUDES_H
40 #include "opj_config_private.h"
65 #if defined(OPJ_HAVE_FSEEKO) && !defined(fseek)
71 #if defined(WIN32) && !defined(Windows95) && !defined(__BORLANDC__) && \
72 !(defined(_MSC_VER) && _MSC_VER < 1400) && \
73 !(defined(__MINGW32__) && __MSVCRT_VERSION__ < 0x800)
79 # define OPJ_FSEEK(stream,offset,whence) _fseeki64(stream, offset,whence)
80 # define OPJ_FSTAT(fildes,stat_buff) _fstati64(fildes, stat_buff)
81 # define OPJ_FTELL(stream) _ftelli64(stream)
82 # define OPJ_STAT_STRUCT_T struct _stati64
83 # define OPJ_STAT(path,stat_buff) _stati64(path, stat_buff)
85 # define OPJ_FSEEK(stream,offset,whence) fseek(stream,offset,whence)
86 # define OPJ_FSTAT(fildes,stat_buff) fstat(fildes,stat_buff)
87 # define OPJ_FTELL(stream) ftell(stream)
88 # define OPJ_STAT_STRUCT_T struct stat
89 # define OPJ_STAT(path,stat_buff) stat(path,stat_buff)
107 #if (__STDC_VERSION__ >= 199901L)
108 #define OPJ_RESTRICT restrict
111 #if defined(__GNUC__)
112 #define OPJ_RESTRICT __restrict__
125 #ifdef __has_attribute
126 #if __has_attribute(no_sanitize)
127 #define OPJ_NOSANITIZE(kind) __attribute__((no_sanitize(kind)))
130 #ifndef OPJ_NOSANITIZE
131 #define OPJ_NOSANITIZE(kind)
136 #if defined(_MSC_VER)
141 return _mm_cvt_ss2si(_mm_load_ss(&f));
145 #elif defined(_M_IX86)
154 return (
long)((f>0.0f) ? (f + 0.5f) : (f - 0.5f));
157 #elif defined(__BORLANDC__)
161 return (
long)((f > 0.0f) ? (f + 0.5f) : (f - 0.5f));
180 #if defined(_MSC_VER) && (_MSC_VER < 1400)
181 #define vsnprintf _vsnprintf
185 #if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__INTEL_COMPILER) && defined(_M_IX86)
187 # pragma intrinsic(__emul)
203 #if defined(_M_IX86_FP)
219 #define OPJ_UNUSED(x) (void)x
257 #include "openjpwl/jpwl.h"