summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua MacDonald <jmacd@users.noreply.github.com>2017-05-16 23:21:16 -0700
committerGitHub <noreply@github.com>2017-05-16 23:21:16 -0700
commit13b7c970bc494d0e7dd293b55a3fcd097190854d (patch)
tree06ebc5341d2bce7fd8fb30e0a1add2aa98ff6a40
parent5bb1efdf838b69e865dd46b8a642f211ea13316f (diff)
parent3adeb629b32b379834f61e2f46d80f62346fdf08 (diff)
Merge pull request #219 from fuzzac/release3_1_apl
Make it easier to compile on windows.
-rw-r--r--xdelta3/xdelta3-internal.h4
-rw-r--r--xdelta3/xdelta3.h15
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
371uint32_t xd3_large32_cksum (xd3_hash_cfg *cfg, const uint8_t *base, const usize_t look); 371uint32_t xd3_large32_cksum (xd3_hash_cfg *cfg, const uint8_t *base, const usize_t look);
372uint32_t xd3_large32_cksum_update (xd3_hash_cfg *cfg, uint32_t cksum, 372uint32_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
377uint64_t xd3_large64_cksum (xd3_hash_cfg *cfg, const uint8_t *base, const usize_t look); 377uint64_t xd3_large64_cksum (xd3_hash_cfg *cfg, const uint8_t *base, const usize_t look);
378uint64_t xd3_large64_cksum_update (xd3_hash_cfg *cfg, uint64_t cksum, 378uint64_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
1109extern "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