summaryrefslogtreecommitdiff
path: root/xdelta3/xdelta3.h
diff options
context:
space:
mode:
Diffstat (limited to 'xdelta3/xdelta3.h')
-rw-r--r--xdelta3/xdelta3.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/xdelta3/xdelta3.h b/xdelta3/xdelta3.h
index 66def15..ec971b9 100644
--- a/xdelta3/xdelta3.h
+++ b/xdelta3/xdelta3.h
@@ -110,7 +110,6 @@
110 */ 110 */
111#ifndef _WIN32 111#ifndef _WIN32
112#include <stdint.h> 112#include <stdint.h>
113typedef uint32_t usize_t;
114#else 113#else
115#define WIN32_LEAN_AND_MEAN 114#define WIN32_LEAN_AND_MEAN
116#if XD3_USE_LARGEFILE64 115#if XD3_USE_LARGEFILE64
@@ -125,10 +124,8 @@ typedef uint32_t usize_t;
125#define _WIN32_WINNT 0x0400 124#define _WIN32_WINNT 0x0400
126#endif 125#endif
127#include <windows.h> 126#include <windows.h>
128typedef uint32_t usize_t;
129#ifdef _MSC_VER 127#ifdef _MSC_VER
130#define inline 128#define inline
131typedef signed int ssize_t;
132#if _MSC_VER < 1600 129#if _MSC_VER < 1600
133typedef unsigned char uint8_t; 130typedef unsigned char uint8_t;
134typedef unsigned short uint16_t; 131typedef unsigned short uint16_t;
@@ -144,6 +141,8 @@ typedef ULONGLONG uint64_t;
144#endif 141#endif
145#endif 142#endif
146 143
144typedef uint32_t usize_t;
145
147#if XD3_USE_LARGEFILE64 146#if XD3_USE_LARGEFILE64
148#define __USE_FILE_OFFSET64 1 /* GLIBC: for 64bit fileops, ... ? */ 147#define __USE_FILE_OFFSET64 1 /* GLIBC: for 64bit fileops, ... ? */
149#ifndef _LARGEFILE_SOURCE 148#ifndef _LARGEFILE_SOURCE
@@ -753,7 +752,7 @@ struct _xd3_source
753 * source position to be read. 752 * source position to be read.
754 * Otherwise, equal to 753 * Otherwise, equal to
755 * max_blkno. */ 754 * max_blkno. */
756 usize_t onlastblk; /* Number of bytes on max_blkno */ 755 xoff_t onlastblk; /* Number of bytes on max_blkno */
757 int eof_known; /* Set to true when the first 756 int eof_known; /* Set to true when the first
758 * partial block is read. */ 757 * partial block is read. */
759}; 758};
@@ -1315,9 +1314,9 @@ static inline
1315void xd3_blksize_div (const xoff_t offset, 1314void xd3_blksize_div (const xoff_t offset,
1316 const xd3_source *source, 1315 const xd3_source *source,
1317 xoff_t *blkno, 1316 xoff_t *blkno,
1318 usize_t *blkoff) { 1317 xoff_t *blkoff) {
1319 *blkno = (xoff_t) (offset >> source->shiftby); 1318 *blkno = (xoff_t) (offset >> source->shiftby);
1320 *blkoff = (usize_t) (offset & source->maskby); 1319 *blkoff = (xoff_t) (offset & source->maskby);
1321 XD3_ASSERT (*blkoff < source->blksize); 1320 XD3_ASSERT (*blkoff < source->blksize);
1322} 1321}
1323 1322