Merge pull request #438 from mrdeep1/windows_builds

Windows: Update code to build on Windows
This commit is contained in:
obgm authored and GitHub committed 2020-01-15 17:35:32 +01:00
commit 183450f5d0
3 files changed
+25

No files matched your search

+9
View File
@@ -21,6 +21,15 @@
#if !defined(S_ISDIR)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
static char* strndup(const char* s1, size_t n)
{
char* copy = (char*)malloc(n + 1);
if (copy) {
memcpy(copy, s1, n);
copy[n] = 0;
}
return copy;
};
#else
#include <unistd.h>
#include <sys/select.h>
+12
View File
@@ -23,6 +23,18 @@
#if !defined(S_ISDIR)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
#ifndef R_OK
#define R_OK 4
#endif
static char* strndup(const char* s1, size_t n)
{
char* copy = (char*)malloc(n + 1);
if (copy) {
memcpy(copy, s1, n);
copy[n] = 0;
}
return copy;
};
#else
#include <unistd.h>
#include <sys/select.h>
+4
View File
@@ -60,6 +60,10 @@
#define UNUSED
#endif /* __GNUC__ */
#ifdef _WIN32
#define strcasecmp _stricmp
#endif
/* RFC6091/RFC7250 */
#ifndef TLSEXT_TYPE_client_certificate_type
#define TLSEXT_TYPE_client_certificate_type 19