Fix compilation with VS2017

The primary issue is that in MSVC 14.00 (VS2015) Microsoft added
snprintf as a function to the standard library and prevents users from
defining it to something else (typically, this was _snprintf). So, only
define it when using _MSC_VER < 1900.

Other changes are:
- Fix macro definition of dup2
- Add macro for getpid
- Add function definition for win32_dup
- Add missing EXTERNs

Signed-off-by: Tim Crawford <crawfxrd@gmail.com>
This commit is contained in:
Tim Crawford
2017-11-28 20:45:51 -05:00
parent 0593ac20de
commit cdb437c545
4 changed files with 15 additions and 7 deletions

View File

@@ -22,6 +22,7 @@
#define _GNU_SOURCE
#if defined(WIN32)
#include "win32/win32_compat.h"
#else
#include <strings.h>
#include <unistd.h>