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

@@ -1102,7 +1102,7 @@ void iscsi_set_bind_interfaces(struct iscsi_context *iscsi, char * interfaces _U
#endif
}
#ifdef WIN32
#if defined(_MSC_VER) && _MSC_VER < 1900
static iscsi_transport iscsi_transport_tcp = {
iscsi_tcp_connect,
iscsi_tcp_queue_pdu,