vc_compat.h revision fb3e20e0
1/* Copyright (c) 2017 - 2020 LiteSpeed Technologies Inc. See LICENSE. */ 2#pragma once 3#include <Windows.h> 4#include <winsock2.h> 5typedef SSIZE_T ssize_t; 6struct iovec { 7 void *iov_base; /* Starting address */ 8 size_t iov_len; /* Number of bytes to transfer */ 9}; 10#define strcasecmp(a,b) _strcmpi(a,b) 11#define strncasecmp _strnicmp 12#define strdup _strdup 13#define PATH_MAX MAX_PATH 14 15#define posix_memalign(p, a, s) (((*(p)) = _aligned_malloc((s), (a))), *(p) ?0 :errno) 16 17#pragma warning(disable: 4018 4100 4127 4189 4200 4204 4152 4221 4244 4245 4267 4334 4702 4706 4804 ) 18 /* 19 4018:signed/unsigned mismatch 20 4100:unreferenced formal parameter, 21 4127: conditional expression is constant 22 4152: nonstandard extension, function/data pointer conversion in expression 23 4189:local variable is initialized but not referenced 24 4200:zero-sized-array in struct, 25 4204: nonstandard extension used: non-constant aggregate initializer, 26 4221: nonstandard extension used:xx cannot be initialized using address of automatic variable y, 27 4244: '+=': conversion from 'int' to 'unsigned short', possible loss of data 28 4245:'=': conversion from 'int' to 'unsigned int', signed/unsigned mismatch 29 4267 function': conversion from 'size_t' to 'int', possible loss of data 30 4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) 31 4702: unreachable code 32 4706: assignment within conditional expression, 33 4804: '-': unsafe use of type 'bool' in operation 34 */ 35 36