Commit 2f4fc026 authored by rnk@chromium.org's avatar rnk@chromium.org

Apply upstream qcmstypes.h patch to avoid conflicts with MSVC's stdint.h

This avoids errors from Clang about a conflicting typedef for
uintptr_t, which should really be unsigned int instead of unsigned
long.  We already had a local patch to suppress MSVC's warning here.
Rather than trying to get the right definition, just include stdint.h,
which has been available since VS2010.

R=thakis@chromium.org
TBR=brettw@chromium.org
BUG=82385

Review URL: https://codereview.chromium.org/224883004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276887 0039d316-1c4b-4281-b951-d872f2087c98
parent 4c2eb40e
......@@ -34,5 +34,7 @@ google.patch contains the following modifications. Apply with
- https://bugzilla.mozilla.org/show_bug.cgi?id=853169
- Apply upstream fix for qcms_profile_from_memory from
- https://bugzilla.mozilla.org/show_bug.cgi?id=969226
- Apply upstream simplification of qcmstypes.h
- https://hg.mozilla.org/mozilla-central/rev/b5be94737a83
To regenerate google.patch:
git diff b8456f38 src > google.patch
......@@ -171,10 +171,57 @@ index 53a3420..fb53e96 100644
+
+#endif
diff --git a/third_party/qcms/src/qcmstypes.h b/third_party/qcms/src/qcmstypes.h
index 56d8de3..9a9b197 100644
index 56d8de3..d58f691 100644
--- a/third_party/qcms/src/qcmstypes.h
+++ b/third_party/qcms/src/qcmstypes.h
@@ -87,7 +87,12 @@ typedef unsigned __int64 uint64_t;
@@ -22,37 +22,6 @@
#ifndef QCMS_TYPES_H
#define QCMS_TYPES_H
-#ifdef MOZ_QCMS
-
-#include "prtypes.h"
-
-/* prtypes.h defines IS_LITTLE_ENDIAN and IS_BIG ENDIAN */
-
-#if defined (__SVR4) && defined (__sun)
-/* int_types.h gets included somehow, so avoid redefining the types differently */
-#include <sys/int_types.h>
-#elif defined (_AIX)
-#include <sys/types.h>
-#elif !defined(ANDROID) && !defined(__OpenBSD__)
-typedef PRInt8 int8_t;
-typedef PRUint8 uint8_t;
-typedef PRInt16 int16_t;
-typedef PRUint16 uint16_t;
-typedef PRInt32 int32_t;
-typedef PRUint32 uint32_t;
-typedef PRInt64 int64_t;
-typedef PRUint64 uint64_t;
-
-#ifdef __OS2__
-/* OS/2's stdlib typdefs uintptr_t. So we'll just include that so we don't collide */
-#include <stdlib.h>
-#elif !defined(__intptr_t_defined) && !defined(_UINTPTR_T_DEFINED)
-typedef PRUptrdiff uintptr_t;
-#endif
-#endif
-
-#else // MOZ_QCMS
-
#if BYTE_ORDER == LITTLE_ENDIAN
#define IS_LITTLE_ENDIAN
#elif BYTE_ORDER == BIG_ENDIAN
@@ -75,7 +44,7 @@ typedef PRUptrdiff uintptr_t;
#if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || defined (_sgi) || defined (__sun) || defined (sun) || defined (__digital__)
# include <inttypes.h>
-#elif defined (_MSC_VER)
+#elif defined (_MSC_VER) && _MSC_VER < 1600
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
@@ -87,7 +56,12 @@ typedef unsigned __int64 uint64_t;
#ifdef _WIN64
typedef unsigned __int64 uintptr_t;
#else
......@@ -187,6 +234,15 @@ index 56d8de3..9a9b197 100644
#endif
#elif defined (_AIX)
@@ -96,8 +70,6 @@ typedef unsigned long uintptr_t;
# include <stdint.h>
#endif
-#endif
-
typedef qcms_bool bool;
#define true 1
#define false 0
diff --git a/third_party/qcms/src/transform-sse1.c b/third_party/qcms/src/transform-sse1.c
index 2f34db5..aaee1bf 100644
--- a/third_party/qcms/src/transform-sse1.c
......
......@@ -22,37 +22,6 @@
#ifndef QCMS_TYPES_H
#define QCMS_TYPES_H
#ifdef MOZ_QCMS
#include "prtypes.h"
/* prtypes.h defines IS_LITTLE_ENDIAN and IS_BIG ENDIAN */
#if defined (__SVR4) && defined (__sun)
/* int_types.h gets included somehow, so avoid redefining the types differently */
#include <sys/int_types.h>
#elif defined (_AIX)
#include <sys/types.h>
#elif !defined(ANDROID) && !defined(__OpenBSD__)
typedef PRInt8 int8_t;
typedef PRUint8 uint8_t;
typedef PRInt16 int16_t;
typedef PRUint16 uint16_t;
typedef PRInt32 int32_t;
typedef PRUint32 uint32_t;
typedef PRInt64 int64_t;
typedef PRUint64 uint64_t;
#ifdef __OS2__
/* OS/2's stdlib typdefs uintptr_t. So we'll just include that so we don't collide */
#include <stdlib.h>
#elif !defined(__intptr_t_defined) && !defined(_UINTPTR_T_DEFINED)
typedef PRUptrdiff uintptr_t;
#endif
#endif
#else // MOZ_QCMS
#if BYTE_ORDER == LITTLE_ENDIAN
#define IS_LITTLE_ENDIAN
#elif BYTE_ORDER == BIG_ENDIAN
......@@ -75,7 +44,7 @@ typedef PRUptrdiff uintptr_t;
#if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || defined (_sgi) || defined (__sun) || defined (sun) || defined (__digital__)
# include <inttypes.h>
#elif defined (_MSC_VER)
#elif defined (_MSC_VER) && _MSC_VER < 1600
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
......@@ -101,8 +70,6 @@ typedef unsigned long uintptr_t;
# include <stdint.h>
#endif
#endif
typedef qcms_bool bool;
#define true 1
#define false 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment