History

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.

Martin Storsjö committed 12 years ago

Commit 41a25161 parent eeb11572 files · +7 −10Browse files

Showing the changes to codec/processing (2 of 2 files). Show all

Unified · Split

2 files
  1. codec/processing/src/common/typedef.h +6 −9
  2. codec/processing/src/common/util.h +1 −1
codec/processing/src/common/typedef.h+6−9
@@ -50,6 +50,12 @@ · 49 unmodified lines
50#define WELSVP_NAMESPACE_BEGIN namespace nsWelsVP {50#define WELSVP_NAMESPACE_BEGIN namespace nsWelsVP {
51#define WELSVP_NAMESPACE_END }51#define WELSVP_NAMESPACE_END }
52 52
53#ifdef _MSC_VER
54#include <stddef.h>
55#else
56#include <stdint.h>
57#endif
58
53WELSVP_NAMESPACE_BEGIN59WELSVP_NAMESPACE_BEGIN
54 60
55#if ( defined(_WIN32) || defined(_WIN32) ) && defined(_MSC_VER)61#if ( defined(_WIN32) || defined(_WIN32) ) && defined(_MSC_VER)
@@ -66,15 +72,6 @@ typedef unsigned __int64 uint64_t ; · 10 unmodified lines
66 72
67#else // GCC73#else // GCC
68 74
69typedef signed char int8_t
70; // [comment]: some compilers may identify the type "char" as "unsigned char" as default, so declare it explicit
71typedef unsigned char uint8_t ;
72typedef signed short int16_t ;
73typedef unsigned short uint16_t ;
74typedef signed int int32_t ;
75typedef unsigned int uint32_t ;
76typedef long long int64_t ;
77typedef unsigned long long uint64_t ;
78#define inline_t inline75#define inline_t inline
79 76
80#endif77#endif
codec/processing/src/common/util.h+1−1
@@ -77,7 +77,7 @@ WELSVP_NAMESPACE_BEGIN · 76 unmodified lines
77#define WELS_ALIGN4(iInput) ((iInput+3) & ~3)77#define WELS_ALIGN4(iInput) ((iInput+3) & ~3)
78#define WELS_ALIGN8(iInput) ((iInput+7) & ~7)78#define WELS_ALIGN8(iInput) ((iInput+7) & ~7)
79 79
80#define WelsCastFromPointer(p) (reinterpret_cast<long_t>(p))80#define WelsCastFromPointer(p) (reinterpret_cast<intptr_t>(p))
81#define WelsStaticCast(type, p) (static_cast<type>(p))81#define WelsStaticCast(type, p) (static_cast<type>(p))
82#define WelsDynamicCast(type, p) (dynamic_cast<type>(p))82#define WelsDynamicCast(type, p) (dynamic_cast<type>(p))
83 83

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t