diff options
author | Yann Collet <yann.collet.73@gmail.com> | 2015-05-28 01:04:17 (GMT) |
---|---|---|
committer | Yann Collet <yann.collet.73@gmail.com> | 2015-05-28 01:04:17 (GMT) |
commit | 7f3d82def8323f7beb5047d36949b1cb9267b925 (patch) | |
tree | 46717647558fbff2856105abc710e1513dbcdc8c /programs/lz4io.c | |
parent | 6f50184a4f50e435f6b3322c68b8b8114544496c (diff) | |
parent | f0a0e4430bd983ce3e054735717f89a095416f24 (diff) | |
download | lz4-7f3d82def8323f7beb5047d36949b1cb9267b925.zip lz4-7f3d82def8323f7beb5047d36949b1cb9267b925.tar.gz lz4-7f3d82def8323f7beb5047d36949b1cb9267b925.tar.bz2 |
Merge pull request #114 from lpsantil/djgpp
Djgpp
Diffstat (limited to 'programs/lz4io.c')
-rw-r--r-- | programs/lz4io.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/programs/lz4io.c b/programs/lz4io.c index e782664..19db03b 100644 --- a/programs/lz4io.c +++ b/programs/lz4io.c @@ -64,11 +64,16 @@ #if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(_WIN32) # include <fcntl.h> /* _O_BINARY */ # include <io.h> /* _setmode, _fileno, _get_osfhandle */ -# define SET_BINARY_MODE(file) _setmode(_fileno(file), _O_BINARY) -# include <Windows.h> /* DeviceIoControl, HANDLE, FSCTL_SET_SPARSE */ -# define SET_SPARSE_FILE_MODE(file) { DWORD dw; DeviceIoControl((HANDLE) _get_osfhandle(_fileno(file)), FSCTL_SET_SPARSE, 0, 0, 0, 0, &dw, 0); } -# if defined(_MSC_VER) && (_MSC_VER >= 1400) /* Avoid MSVC fseek()'s 2GiB barrier */ -# define fseek _fseeki64 +# if !defined(__DJGPP__) +# define SET_BINARY_MODE(file) _setmode(_fileno(file), _O_BINARY) +# include <Windows.h> /* DeviceIoControl, HANDLE, FSCTL_SET_SPARSE */ +# define SET_SPARSE_FILE_MODE(file) { DWORD dw; DeviceIoControl((HANDLE) _get_osfhandle(_fileno(file)), FSCTL_SET_SPARSE, 0, 0, 0, 0, &dw, 0); } +# if defined(_MSC_VER) && (_MSC_VER >= 1400) /* Avoid MSVC fseek()'s 2GiB barrier */ +# define fseek _fseeki64 +# endif +# else +# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) +# define SET_SPARSE_FILE_MODE(file) # endif #else # define SET_BINARY_MODE(file) |