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

This commit is contained in:
Robert Jongbloed 2012-09-27 10:15:24 +10:00
parent 9d2aa0cd4c
commit cf0f483aab
8 changed files with 11 additions and 27 deletions

View File

@ -221,6 +221,7 @@ typedef enum {
#include <winsock2.h>
#include <windows.h>
typedef SOCKET esl_socket_t;
#if !defined(_STDINT) && !defined(uint32_t)
typedef unsigned __int64 uint64_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int16 uint16_t;
@ -229,6 +230,7 @@ typedef __int64 int64_t;
typedef __int32 int32_t;
typedef __int16 int16_t;
typedef __int8 int8_t;
#endif
typedef intptr_t esl_ssize_t;
typedef int esl_filehandle_t;
#define ESL_SOCK_INVALID INVALID_SOCKET

View File

@ -42,7 +42,7 @@ extern "C" {
#ifdef _MSC_VER
#ifndef uint32_t
#if !defined(_STDINT) && !defined(uint32_t)
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;

View File

@ -91,6 +91,7 @@ extern "C" {
#define __inline__ __inline
#endif
#if !defined(_STDINT) && !defined(uint32_t)
typedef unsigned __int64 uint64_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int16 uint16_t;
@ -99,6 +100,7 @@ typedef __int64 int64_t;
typedef __int32 int32_t;
typedef __int16 int16_t;
typedef __int8 int8_t;
#endif
#else
#include <stdint.h>
#endif

View File

@ -49,7 +49,7 @@ extern "C" {
#endif
#ifdef _MSC_VER
#ifndef uint32_t
#if !defined(_STDINT) && !defined(uint32_t)
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;

View File

@ -49,11 +49,13 @@ extern "C" {
#ifndef __inline__
#define __inline__ __inline
#endif
#if !defined(_STDINT) && !defined(uint32_t)
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
typedef __int32 int32_t;
typedef unsigned __int16 uint16_t;
#endif
#endif
#if defined(__i386__)
/*! \brief Find the bit position of the highest set bit in a word

View File

@ -50,11 +50,13 @@ extern "C" {
#ifndef __inline__
#define __inline__ __inline
#endif
#if !defined(_STDINT) && !defined(uint32_t)
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
typedef __int32 int32_t;
typedef unsigned __int16 uint16_t;
#endif
#endif
#if defined(__i386__)
/*! \brief Find the bit position of the highest set bit in a word

View File

@ -88,7 +88,7 @@ SWITCH_BEGIN_EXTERN_C
#endif
#undef inline
#define inline __inline
#ifndef uint32_t
#if !defined(_STDINT) && !defined(uint32_t)
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;

View File

@ -49,31 +49,7 @@
#undef strcasecmp
#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>
#undef uint32_t
#include <switch_version.h>
#define MODNAME "mod_opal"