shithub: openh264

Download patch

ref: 41a251630d35744d4a268d2df340cddecb71adaa
parent: eeb11578cad1f284eefd90ab203fac4b5b8c2f69
author: Martin Storsjö <[email protected]>
date: Thu Jan 9 10:24:20 EST 2014

Use intptr_t instead of long for casting pointers to integers

This fixes building on mingw-w64.

Include stdint.h on everything except MSVC for definitions of
common standard types, include stddef.h on MSVC instead, since
MSVC doesn't have stdint.h in all older versions that are
supposed to be supported, but MSVC always defines intptr_t via
stddef.h.

--- a/codec/processing/src/common/typedef.h
+++ b/codec/processing/src/common/typedef.h
@@ -50,6 +50,12 @@
 #define WELSVP_NAMESPACE_BEGIN      namespace nsWelsVP {
 #define WELSVP_NAMESPACE_END        }
 
+#ifdef _MSC_VER
+#include <stddef.h>
+#else
+#include <stdint.h>
+#endif
+
 WELSVP_NAMESPACE_BEGIN
 
 #if ( defined(_WIN32) || defined(_WIN32) ) && defined(_MSC_VER)
@@ -66,15 +72,6 @@
 
 #else	// GCC
 
-typedef signed char        int8_t
-; // [comment]: some compilers may identify the type "char" as "unsigned char" as default, so declare it explicit
-typedef unsigned char      uint8_t  ;
-typedef signed short       int16_t  ;
-typedef unsigned short     uint16_t ;
-typedef signed int         int32_t  ;
-typedef unsigned int       uint32_t ;
-typedef long long          int64_t  ;
-typedef unsigned long long uint64_t ;
 #define inline_t           inline
 
 #endif
--- a/codec/processing/src/common/util.h
+++ b/codec/processing/src/common/util.h
@@ -77,7 +77,7 @@
 #define WELS_ALIGN4(iInput)  ((iInput+3) & ~3)
 #define WELS_ALIGN8(iInput)  ((iInput+7) & ~7)
 
-#define WelsCastFromPointer(p)      (reinterpret_cast<long_t>(p))
+#define WelsCastFromPointer(p)      (reinterpret_cast<intptr_t>(p))
 #define WelsStaticCast(type, p)  (static_cast<type>(p))
 #define WelsDynamicCast(type, p) (dynamic_cast<type>(p))