Add ZIP_STATIC for Windows static library compilation, and add a paragraph in README explaining it.
diff --git a/README b/README index 756a282..de9171f 100644 --- a/README +++ b/README
@@ -17,6 +17,9 @@ with most operating systems nowadays, or you can get it at http://www.gzip.org/zlib/ + When using a static Windows library, you need to define ZIP_STATIC +when compiling packages using libzip. + If you make a binary distribution, please include a pointer to the distribution site: http://www.nih.at/libzip/
diff --git a/lib/zip.h b/lib/zip.h index 050db76..ba38ac8 100644 --- a/lib/zip.h +++ b/lib/zip.h
@@ -3,7 +3,7 @@ /* zip.h -- exported declarations. - Copyright (C) 1999-2012 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2014 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -36,13 +36,17 @@ #ifndef ZIP_EXTERN -#ifdef _WIN32 -#define ZIP_EXTERN __declspec(dllimport) -#elif defined(__GNUC__) && __GNUC__ >= 4 -#define ZIP_EXTERN __attribute__ ((visibility ("default"))) -#else -#define ZIP_EXTERN -#endif +# ifndef ZIP_STATIC +# ifdef _WIN32 +# define ZIP_EXTERN __declspec(dllimport) +# elif defined(__GNUC__) && __GNUC__ >= 4 +# define ZIP_EXTERN __attribute__ ((visibility ("default"))) +# else +# define ZIP_EXTERN +# endif +# else +# define ZIP_EXTERN +# endif #endif #ifdef __cplusplus