提交 cf0f483a authored 作者: Robert Jongbloed's avatar Robert Jongbloed

Assuming, just because it is MSVC, that the standard integers are not defined,…

Assuming, just because it is MSVC, that the standard integers are not defined, is not correct. Need to test for define _STDINT as well as later versions of MSVC (>= VS2010) do have stdint.h
上级 9d2aa0cd
...@@ -221,6 +221,7 @@ typedef enum { ...@@ -221,6 +221,7 @@ typedef enum {
#include <winsock2.h> #include <winsock2.h>
#include <windows.h> #include <windows.h>
typedef SOCKET esl_socket_t; typedef SOCKET esl_socket_t;
#if !defined(_STDINT) && !defined(uint32_t)
typedef unsigned __int64 uint64_t; typedef unsigned __int64 uint64_t;
typedef unsigned __int32 uint32_t; typedef unsigned __int32 uint32_t;
typedef unsigned __int16 uint16_t; typedef unsigned __int16 uint16_t;
...@@ -229,6 +230,7 @@ typedef __int64 int64_t; ...@@ -229,6 +230,7 @@ typedef __int64 int64_t;
typedef __int32 int32_t; typedef __int32 int32_t;
typedef __int16 int16_t; typedef __int16 int16_t;
typedef __int8 int8_t; typedef __int8 int8_t;
#endif
typedef intptr_t esl_ssize_t; typedef intptr_t esl_ssize_t;
typedef int esl_filehandle_t; typedef int esl_filehandle_t;
#define ESL_SOCK_INVALID INVALID_SOCKET #define ESL_SOCK_INVALID INVALID_SOCKET
......
...@@ -42,7 +42,7 @@ extern "C" { ...@@ -42,7 +42,7 @@ extern "C" {
#ifdef _MSC_VER #ifdef _MSC_VER
#ifndef uint32_t #if !defined(_STDINT) && !defined(uint32_t)
typedef unsigned __int8 uint8_t; typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t; typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t; typedef unsigned __int32 uint32_t;
......
...@@ -91,6 +91,7 @@ extern "C" { ...@@ -91,6 +91,7 @@ extern "C" {
#define __inline__ __inline #define __inline__ __inline
#endif #endif
#if !defined(_STDINT) && !defined(uint32_t)
typedef unsigned __int64 uint64_t; typedef unsigned __int64 uint64_t;
typedef unsigned __int32 uint32_t; typedef unsigned __int32 uint32_t;
typedef unsigned __int16 uint16_t; typedef unsigned __int16 uint16_t;
...@@ -99,6 +100,7 @@ typedef __int64 int64_t; ...@@ -99,6 +100,7 @@ typedef __int64 int64_t;
typedef __int32 int32_t; typedef __int32 int32_t;
typedef __int16 int16_t; typedef __int16 int16_t;
typedef __int8 int8_t; typedef __int8 int8_t;
#endif
#else #else
#include <stdint.h> #include <stdint.h>
#endif #endif
......
...@@ -49,7 +49,7 @@ extern "C" { ...@@ -49,7 +49,7 @@ extern "C" {
#endif #endif
#ifdef _MSC_VER #ifdef _MSC_VER
#ifndef uint32_t #if !defined(_STDINT) && !defined(uint32_t)
typedef unsigned __int8 uint8_t; typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t; typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t; typedef unsigned __int32 uint32_t;
......
...@@ -49,11 +49,13 @@ extern "C" { ...@@ -49,11 +49,13 @@ extern "C" {
#ifndef __inline__ #ifndef __inline__
#define __inline__ __inline #define __inline__ __inline
#endif #endif
#if !defined(_STDINT) && !defined(uint32_t)
typedef unsigned __int8 uint8_t; typedef unsigned __int8 uint8_t;
typedef __int16 int16_t; typedef __int16 int16_t;
typedef __int32 int32_t; typedef __int32 int32_t;
typedef unsigned __int16 uint16_t; typedef unsigned __int16 uint16_t;
#endif #endif
#endif
#if defined(__i386__) #if defined(__i386__)
/*! \brief Find the bit position of the highest set bit in a word /*! \brief Find the bit position of the highest set bit in a word
......
...@@ -50,11 +50,13 @@ extern "C" { ...@@ -50,11 +50,13 @@ extern "C" {
#ifndef __inline__ #ifndef __inline__
#define __inline__ __inline #define __inline__ __inline
#endif #endif
#if !defined(_STDINT) && !defined(uint32_t)
typedef unsigned __int8 uint8_t; typedef unsigned __int8 uint8_t;
typedef __int16 int16_t; typedef __int16 int16_t;
typedef __int32 int32_t; typedef __int32 int32_t;
typedef unsigned __int16 uint16_t; typedef unsigned __int16 uint16_t;
#endif #endif
#endif
#if defined(__i386__) #if defined(__i386__)
/*! \brief Find the bit position of the highest set bit in a word /*! \brief Find the bit position of the highest set bit in a word
......
...@@ -88,7 +88,7 @@ SWITCH_BEGIN_EXTERN_C ...@@ -88,7 +88,7 @@ SWITCH_BEGIN_EXTERN_C
#endif #endif
#undef inline #undef inline
#define inline __inline #define inline __inline
#ifndef uint32_t #if !defined(_STDINT) && !defined(uint32_t)
typedef unsigned __int8 uint8_t; typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t; typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t; typedef unsigned __int32 uint32_t;
......
...@@ -49,31 +49,7 @@ ...@@ -49,31 +49,7 @@
#undef strcasecmp #undef strcasecmp
#undef strncasecmp #undef strncasecmp
#ifdef _MSC_VER
/*The following insanity is because libteletone_generate.h defines int8_t in
a slightly different manner to most other cases (SDL, PCAP, Java V8,
VS2010's own stdint.h, etc) and does not provide a mechanism to prevent it's
inclusion. Then, to cap it off, MSVC barfs on the difference.
Sigh.
*/
#pragma include_alias(<libteletone.h>, <../../libs/libteletone/src/libteletone.h>)
#pragma include_alias(<libteletone_generate.h>, <../../libs/libteletone/src/libteletone_generate.h>)
#pragma include_alias(<libteletone_detect.h>, <../../libs/libteletone/src/libteletone_detect.h>)
#define int8_t signed int8_t
#include <libteletone_generate.h>
#undef int8_t
#endif // End of insanity
#define HAVE_APR
#define uint32_t uint32_t // Avoid conflict in stdint definitions
#include <switch.h> #include <switch.h>
#undef uint32_t
#include <switch_version.h>
#define MODNAME "mod_opal" #define MODNAME "mod_opal"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论