Robust handling for ssize_t on Win32 platform
Now we define NGHTTP2_SSIZE_T which is typedef-ed to the appropriate type depending on the platform (x86/x86_64). See GH-616 for details
This commit is contained in:
parent
d6def22ad5
commit
c42296acf1
|
@ -62,7 +62,7 @@ AR := lib
|
||||||
#LD := xilink
|
#LD := xilink
|
||||||
#AR := xilib
|
#AR := xilib
|
||||||
RC := rc
|
RC := rc
|
||||||
CFLAGS := -I./includes -Dssize_t=long -D_U_=""
|
CFLAGS := -I./includes -Dssize_t=SSIZE_T -D_U_=""
|
||||||
|
|
||||||
CFLAGS_R := -nologo -MD -W3 -Z7 -DBUILDING_NGHTTP2
|
CFLAGS_R := -nologo -MD -W3 -Z7 -DBUILDING_NGHTTP2
|
||||||
CFLAGS_D := -nologo -MDd -W3 -Z7 -DBUILDING_NGHTTP2 \
|
CFLAGS_D := -nologo -MDd -W3 -Z7 -DBUILDING_NGHTTP2 \
|
||||||
|
|
|
@ -35,6 +35,17 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* For Win32 application, use type NGHTTP2_SSIZE_T instead of
|
||||||
|
ssize_t. */
|
||||||
|
#if defined(WIN32)
|
||||||
|
#pragma once
|
||||||
|
#include <basetsd.h>
|
||||||
|
typedef SSIZE_T NGHTTP2_SSIZE_T;
|
||||||
|
#if !defined(BUILDING_NGHTTP2)
|
||||||
|
#define ssize_t NGHTTP2_SSIZE_T
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#if defined(_MSC_VER) && (_MSC_VER < 1800)
|
#if defined(_MSC_VER) && (_MSC_VER < 1800)
|
||||||
/* MSVC < 2013 does not have inttypes.h because it is not C99
|
/* MSVC < 2013 does not have inttypes.h because it is not C99
|
||||||
|
@ -5003,6 +5014,12 @@ NGHTTP2_EXTERN int32_t nghttp2_stream_get_weight(nghttp2_stream *stream);
|
||||||
NGHTTP2_EXTERN int32_t
|
NGHTTP2_EXTERN int32_t
|
||||||
nghttp2_stream_get_sum_dependency_weight(nghttp2_stream *stream);
|
nghttp2_stream_get_sum_dependency_weight(nghttp2_stream *stream);
|
||||||
|
|
||||||
|
#if defined(WIN32)
|
||||||
|
#if !defined(BUILDING_NGHTTP2)
|
||||||
|
#undef ssize_t
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue