diff options
| author | Julien Malik <julien.malik@paraiso.me> | 2011-11-28 15:32:22 +0000 |
|---|---|---|
| committer | Julien Malik <julien.malik@paraiso.me> | 2011-11-28 15:32:22 +0000 |
| commit | 2eba4fb96b97df690139f8c0352f8080acc4014f (patch) | |
| tree | 96b0f0dab6a492cdebbc77f869039d97bc7cfe90 /libopenjpeg | |
| parent | 27ba604ad793ea14bbaa2ec53e19d019b5941034 (diff) | |
[trunk] activate LargeFileSupport in CMake
Diffstat (limited to 'libopenjpeg')
| -rw-r--r-- | libopenjpeg/opj_includes.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/libopenjpeg/opj_includes.h b/libopenjpeg/opj_includes.h index d94237e7..4801ef69 100644 --- a/libopenjpeg/opj_includes.h +++ b/libopenjpeg/opj_includes.h @@ -27,6 +27,12 @@ #define OPJ_INCLUDES_H /* + * This must be included before any system headers, + * since they can react to macro defined there + */ +#include "opj_config.h" + +/* ========================================================== Standard includes used by the library ========================================================== @@ -43,6 +49,40 @@ #include <assert.h> /* + Use fseeko() and ftello() if they are available since they use + 'off_t' rather than 'long'. It is wrong to use fseeko() and + ftello() only on systems with special LFS support since some systems + (e.g. FreeBSD) support a 64-bit off_t by default. +*/ +#if defined(HAVE_FSEEKO) +# define fseek fseeko +# define ftell ftello +#endif + + +#if defined(MSWINDOWS) && !defined(Windows95) && !defined(__BORLANDC__) && \ + !(defined(_MSC_VER) && _MSC_VER < 1400) && \ + !(defined(__MINGW32__) && __MSVCRT_VERSION__ < 0x800) + /* + Windows '95 and Borland C do not support _lseeki64 + Visual Studio does not support _fseeki64 and _ftelli64 until the 2005 release. + Without these interfaces, files over 2GB in size are not supported for Windows. + */ +# define OPJ_FSEEK(stream,offset,whence) _fseeki64(stream,/* __int64 */ offset,whence) +# define OPJ_FSTAT(fildes,stat_buff) _fstati64(fildes,/* struct _stati64 */ stat_buff) +# define OPJ_FTELL(stream) /* __int64 */ _ftelli64(stream) +# define OPJ_STAT_STRUCT_T struct _stati64 +# define OPJ_STAT(path,stat_buff) _stati64(path,/* struct _stati64 */ stat_buff) +#else +# define OPJ_FSEEK(stream,offset,whence) fseek(stream,offset,whence) +# define OPJ_FSTAT(fildes,stat_buff) fstat(fildes,stat_buff) +# define OPJ_FTELL(stream) ftell(stream) +# define OPJ_STAT_STRUCT_T struct stat +# define OPJ_STAT(path,stat_buff) stat(path,stat_buff) +#endif + + +/* ========================================================== OpenJPEG interface ========================================================== |
