From 703c0c9917aafcbedf806398f40e1b5da3212258 Mon Sep 17 00:00:00 2001 From: Michael Sweet Date: Sun, 28 May 2017 22:40:08 -0400 Subject: [PATCH] Sync up with changes to the ZIPC code. --- zipc.c | 4 +--- zipc.h | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/zipc.c b/zipc.c index 8298383..6ee62df 100644 --- a/zipc.c +++ b/zipc.c @@ -33,12 +33,10 @@ #include "zipc.h" #include -#include #include #include #include #include -#include #include @@ -889,7 +887,7 @@ zipc_write_local_trailer( * Update the CRC-32, compressed size, and uncompressed size fields... */ - fseek(zc->fp, zf->offset + 14, SEEK_SET); + fseek(zc->fp, (long)(zf->offset + 14), SEEK_SET); status |= zipc_write_u32(zc, zf->crc32); status |= zipc_write_u32(zc, (unsigned)zf->compressed_size); diff --git a/zipc.h b/zipc.h index 6bb2a8f..21770c8 100644 --- a/zipc.h +++ b/zipc.h @@ -34,6 +34,7 @@ * Include necessary headers... */ +# include # include @@ -49,6 +50,10 @@ typedef struct _zipc_file_s zipc_file_t;/* File/directory in ZIP container */ * Functions... */ +# ifdef __cplusplus +extern "C" { +# endif /* __cplusplus */ + extern int zipcClose(zipc_t *zc); extern int zipcCopyFile(zipc_t *zc, const char *dstname, const char *srcname, int text, int compressed); extern int zipcCreateDirectory(zipc_t *zc, const char *filename); @@ -57,17 +62,21 @@ extern int zipcCreateFileWithString(zipc_t *zc, const char *filename, const cha extern const char *zipcError(zipc_t *zc); extern int zipcFileFinish(zipc_file_t *zf); extern int zipcFilePrintf(zipc_file_t *zf, const char *format, ...) -# ifdef __GNUC__ +# ifdef __GNUC__ __attribute__ ((__format__ (__printf__, 2, 3))) -# endif /* __GNUC__ */ +# endif /* __GNUC__ */ ; extern int zipcFilePuts(zipc_file_t *zf, const char *s); extern int zipcFileWrite(zipc_file_t *zf, const void *data, size_t bytes); extern int zipcFileXMLPrintf(zipc_file_t *zf, const char *format, ...) -# ifdef __GNUC__ +# ifdef __GNUC__ __attribute__ ((__format__ (__printf__, 2, 3))) -# endif /* __GNUC__ */ +# endif /* __GNUC__ */ ; extern zipc_t *zipcOpen(const char *filename, const char *mode); +# ifdef __cplusplus +} +# endif /* __cplusplus */ + #endif /* !ZIPC_H */