Skip to content

Commit aa25356

Browse files
CAIQTenricogior
authored andcommitted
[PR] Fix building problems in MSVS2015.
1 parent 7388b95 commit aa25356

File tree

6 files changed

+22
-5
lines changed

6 files changed

+22
-5
lines changed

Diff for: deps/jemalloc-win/include/msvc_compat/stdint.h

+11-2
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,20 @@ typedef uint64_t uint_least64_t;
103103

104104
// 7.18.1.3 Fastest minimum-width integer types
105105
typedef int8_t int_fast8_t;
106-
typedef int16_t int_fast16_t;
106+
#if (_MSC_VER <= 1800)
107+
typedef int16_t int_fast16_t;
108+
#else
109+
typedef int int_fast16_t;
110+
#endif
111+
107112
typedef int32_t int_fast32_t;
108113
typedef int64_t int_fast64_t;
109114
typedef uint8_t uint_fast8_t;
110-
typedef uint16_t uint_fast16_t;
115+
#if (_MSC_VER <= 1800)
116+
typedef uint16_t uint_fast16_t;
117+
#else
118+
typedef unsigned int uint_fast16_t;
119+
#endif
111120
typedef uint32_t uint_fast32_t;
112121
typedef uint64_t uint_fast64_t;
113122

Diff for: deps/lua/src/fpconv.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737

3838
#ifdef _WIN32
3939
#define inline __inline
40-
#define snprintf _snprintf
40+
#if (_MSC_VER <= 1800)
41+
#define snprintf _snprintf
42+
#endif
4143
#endif
4244

4345
/* Lua CJSON assumes the locale is the same for all threads within a

Diff for: deps/lua/src/luaconf.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,9 @@ union luai_Cast { double l_d; long l_l; };
750750

751751

752752
#ifdef _WIN32
753-
#define snprintf _snprintf
753+
#if (_MSC_VER <= 1800)
754+
#define snprintf _snprintf
755+
#endif
754756
#endif
755757

756758

Diff for: src/Win32_Interop/Win32_FDAPI.h

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ typedef unsigned long nfds_t;
3737
#include <WinSock2.h>
3838
#include <fcntl.h>
3939
#include <stdio.h>
40+
#include <sys/stat.h>
4041

4142
// Including a version of this file modified to eliminate prototype
4243
// definitions not removed by INCL_WINSOCK_API_PROTOTYPES

Diff for: src/Win32_Interop/Win32_Time.h

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
#ifndef WIN32_INTEROP_TIME_H
2626
#define WIN32_INTEROP_TIME_H
2727

28+
#if (_MSC_VER > 1800)
29+
#include <corecrt.h>
30+
#endif
2831
#include <stdint.h>
2932

3033
#define gettimeofday gettimeofday_highres

Diff for: src/redis.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ void freeClientsInAsyncFreeQueue(void);
10871087
void asyncCloseClientOnOutputBufferLimitReached(redisClient *c);
10881088
int getClientType(redisClient *c);
10891089
int getClientTypeByName(char *name);
1090-
char *getClientTypeName(int class);
1090+
char *getClientTypeName(int IF_WIN32(_class,class));
10911091
void flushSlavesOutputBuffers(void);
10921092
void disconnectSlaves(void);
10931093
int listenToPort(int port, int *fds, int *count);

0 commit comments

Comments
 (0)