Bug 487765 - Fix qcms build problems on Solaris. r=jrmuizel
authorGinn Chen <ginn.chen@sun.com>
Tue, 14 Apr 2009 11:25:31 -0400
changeset 27316 6a928bad6136b28a14c81523589acc35022da6ee
parent 27315 ed90488b4d79fd58297b19647aa46f1193ea6a75
child 27317 629e0c724413b5f1dbc41469878b867a5547c66e
push idunknown
push userunknown
push dateunknown
reviewersjrmuizel
bugs487765
milestone1.9.2a1pre
Bug 487765 - Fix qcms build problems on Solaris. r=jrmuizel
gfx/qcms/iccread.c
gfx/qcms/qcmstypes.h
--- a/gfx/qcms/iccread.c
+++ b/gfx/qcms/iccread.c
@@ -24,26 +24,16 @@
 #include <assert.h>
 #include <stdlib.h>
 #include "qcmsint.h"
 
 //XXX: use a better typename
 typedef uint32_t __be32;
 typedef uint16_t __be16;
 
-/* all of the platforms that we use _MSC_VER on are little endian
- * so this is sufficient for now */
-#ifdef _MSC_VER
-#define LITTLE_ENDIAN
-#endif
-
-#ifdef __OS2__
-#define LITTLE_ENDIAN
-#endif
-
 #if !defined(BIG_ENDIAN) && !defined(LITTLE_ENDIAN)
 #error Unknown endianess
 #endif
 
 #if 0
 not used yet
 /* __builtin_bswap isn't available in older gccs
  * so open code it for now */
--- a/gfx/qcms/qcmstypes.h
+++ b/gfx/qcms/qcmstypes.h
@@ -1,15 +1,29 @@
 #ifndef QCMS_TYPES_H
 #define QCMS_TYPES_H
 
 #ifdef MOZ_QCMS
 
 #include "prtypes.h"
 
+#if !defined(BIG_ENDIAN) && !defined(LITTLE_ENDIAN)
+#ifdef IS_LITTLE_ENDIAN
+#define LITTLE_ENDIAN
+#endif
+
+#ifdef IS_BIG_ENDIAN
+#define BIG_ENDIAN
+#endif
+#endif
+
+#if defined (__SVR4) && defined (__sun)
+/* int_types.h gets included somehow, so avoid redefining the types differently */
+#include <sys/int_types.h>
+#else
 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;
@@ -17,18 +31,29 @@ 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(__FreeBSD__)
 /* FreeBSD typedefs uintptr_t in /usr/include/sys/types.h */
 #else
 typedef PRUptrdiff uintptr_t;
 #endif
+#endif
 
-#else
+#else // MOZ_QCMS
+
+/* all of the platforms that we use _MSC_VER on are little endian
+ * so this is sufficient for now */
+#ifdef _MSC_VER
+#define LITTLE_ENDIAN
+#endif
+
+#ifdef __OS2__
+#define LITTLE_ENDIAN
+#endif
 
 #if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || defined (_sgi) || defined (__sun) || defined (sun) || defined (__digital__)
 #  include <inttypes.h>
 #elif defined (_MSC_VER)
 typedef __int8 int8_t;
 typedef unsigned __int8 uint8_t;
 typedef __int16 int16_t;
 typedef unsigned __int16 uint16_t;