Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 8652b4e

Browse files
committed
[[ VS2015 ]] Tweak libzip so it builds using VS2015
This patch tweaks libzip to ensure it compiles under VS2015. It adds a macro to redefine the name of the function snprintf appropriately and workaround to a bug in the MSVS CRT includes which cause the wrong binding of putc when DISABLE_PERFCRIT_LOCKS is defined.
1 parent 9fb5793 commit 8652b4e

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

libzip/src/zip_dirent.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@
4242

4343
#ifndef _WINDOWS
4444
#include <unistd.h>
45+
#else
46+
// A bug in the MSVS2015 CRT means that when _CRT_DISABLE_PERFCRIT_LOCKS is
47+
// set, this function binds incorrectly.
48+
#undef putc
49+
#define putc fputc
4550
#endif
4651

4752
#include <sys/types.h>

libzip/src/zipintw32.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ typedef unsigned short mode_t;
1515

1616
#define fseeko fseek
1717
#define strcasecmp _stricmp
18-
#define snprintf _snprintf
1918
#define fdopen _fdopen
2019
#define strdup _strdup
2120
#define fileno _fileno

0 commit comments

Comments
 (0)