diff options
author | Magnus Danielsson <magnus.danielsson@riotgames.com> | 2016-07-06 15:53:47 -0700 |
---|---|---|
committer | Magnus Danielsson <magnus.danielsson@riotgames.com> | 2016-07-06 15:53:47 -0700 |
commit | 3adeb629b32b379834f61e2f46d80f62346fdf08 (patch) | |
tree | a928a31a47c3a0f2b200143bf9bcbe4146aa7113 | |
parent | a089d04bf19d21a8ac5e03a9066e5a2e36e0b87a (diff) |
Make it easier to compile on windows.
-rw-r--r-- | xdelta3/xdelta3-internal.h | 4 | ||||
-rw-r--r-- | xdelta3/xdelta3.h | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/xdelta3/xdelta3-internal.h b/xdelta3/xdelta3-internal.h index c807648..0c6a1bb 100644 --- a/xdelta3/xdelta3-internal.h +++ b/xdelta3/xdelta3-internal.h | |||
@@ -369,13 +369,13 @@ usize_t xd3_checksum_hash (const xd3_hash_cfg *cfg, const usize_t cksum); | |||
369 | 369 | ||
370 | #if USE_UINT32 | 370 | #if USE_UINT32 |
371 | uint32_t xd3_large32_cksum (xd3_hash_cfg *cfg, const uint8_t *base, const usize_t look); | 371 | uint32_t xd3_large32_cksum (xd3_hash_cfg *cfg, const uint8_t *base, const usize_t look); |
372 | uint32_t xd3_large32_cksum_update (xd3_hash_cfg *cfg, uint32_t cksum, | 372 | uint32_t xd3_large32_cksum_update (xd3_hash_cfg *cfg, const uint32_t cksum, |
373 | const uint8_t *base, const usize_t look); | 373 | const uint8_t *base, const usize_t look); |
374 | #endif /* USE_UINT32 */ | 374 | #endif /* USE_UINT32 */ |
375 | 375 | ||
376 | #if USE_UINT64 | 376 | #if USE_UINT64 |
377 | uint64_t xd3_large64_cksum (xd3_hash_cfg *cfg, const uint8_t *base, const usize_t look); | 377 | uint64_t xd3_large64_cksum (xd3_hash_cfg *cfg, const uint8_t *base, const usize_t look); |
378 | uint64_t xd3_large64_cksum_update (xd3_hash_cfg *cfg, uint64_t cksum, | 378 | uint64_t xd3_large64_cksum_update (xd3_hash_cfg *cfg, const uint64_t cksum, |
379 | const uint8_t *base, const usize_t look); | 379 | const uint8_t *base, const usize_t look); |
380 | #endif /* USE_UINT64 */ | 380 | #endif /* USE_UINT64 */ |
381 | 381 | ||
diff --git a/xdelta3/xdelta3.h b/xdelta3/xdelta3.h index b513efb..f98eb2a 100644 --- a/xdelta3/xdelta3.h +++ b/xdelta3/xdelta3.h | |||
@@ -115,7 +115,9 @@ | |||
115 | #include <inttypes.h> | 115 | #include <inttypes.h> |
116 | #include <stdint.h> | 116 | #include <stdint.h> |
117 | #else /* WIN32 case */ | 117 | #else /* WIN32 case */ |
118 | #ifndef WIN32_LEAN_AND_MEAN | ||
118 | #define WIN32_LEAN_AND_MEAN | 119 | #define WIN32_LEAN_AND_MEAN |
120 | #endif | ||
119 | 121 | ||
120 | #ifndef WINVER | 122 | #ifndef WINVER |
121 | #if XD3_USE_LARGEFILE64 | 123 | #if XD3_USE_LARGEFILE64 |
@@ -378,7 +380,11 @@ typedef struct { | |||
378 | } shortbuf; | 380 | } shortbuf; |
379 | 381 | ||
380 | #ifndef PRINTF_ATTRIBUTE | 382 | #ifndef PRINTF_ATTRIBUTE |
383 | #ifdef __GNUC__ | ||
381 | #define PRINTF_ATTRIBUTE(x,y) __attribute__ ((__format__ (__printf__, x, y))) | 384 | #define PRINTF_ATTRIBUTE(x,y) __attribute__ ((__format__ (__printf__, x, y))) |
385 | #else | ||
386 | #define PRINTF_ATTRIBUTE(x,y) | ||
387 | #endif | ||
382 | #endif | 388 | #endif |
383 | 389 | ||
384 | /* Underlying xprintf() */ | 390 | /* Underlying xprintf() */ |
@@ -1099,6 +1105,11 @@ struct _xd3_stream | |||
1099 | PUBLIC FUNCTIONS | 1105 | PUBLIC FUNCTIONS |
1100 | **************************************************************************/ | 1106 | **************************************************************************/ |
1101 | 1107 | ||
1108 | #ifdef __cplusplus | ||
1109 | extern "C" { | ||
1110 | #endif // __cplusplus | ||
1111 | |||
1112 | |||
1102 | /* This function configures an xd3_stream using the provided in-memory | 1113 | /* This function configures an xd3_stream using the provided in-memory |
1103 | * input buffer, source buffer, output buffer, and flags. The output | 1114 | * input buffer, source buffer, output buffer, and flags. The output |
1104 | * array must be large enough or else ENOSPC will be returned. This | 1115 | * array must be large enough or else ENOSPC will be returned. This |
@@ -1429,6 +1440,10 @@ void xd3_blksize_add (xoff_t *blkno, | |||
1429 | XD3_ASSERT (*blkoff < source->blksize); | 1440 | XD3_ASSERT (*blkoff < source->blksize); |
1430 | } | 1441 | } |
1431 | 1442 | ||
1443 | #ifdef __cplusplus | ||
1444 | } // extern "C" | ||
1445 | #endif | ||
1446 | |||
1432 | #define XD3_NOOP 0U | 1447 | #define XD3_NOOP 0U |
1433 | #define XD3_ADD 1U | 1448 | #define XD3_ADD 1U |
1434 | #define XD3_RUN 2U | 1449 | #define XD3_RUN 2U |