Bug 487566 - OS/2 problems to build qcms; r=mozilla@Weilbacher.org
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Sat, 11 Apr 2009 09:53:40 +0200
changeset 27206 25f74e0b80a6d6d7e109ede7856f638931f7e065
parent 27205 3b57ad0d0ed83db8b3562425566f89153d352e7b
child 27207 50a692b9e8973998286aab6dfa62440cdddb6117
push idunknown
push userunknown
push dateunknown
reviewersmozilla
bugs487566
milestone1.9.2a1pre
Bug 487566 - OS/2 problems to build qcms; r=mozilla@Weilbacher.org
gfx/qcms/iccread.c
gfx/qcms/qcmsint.h
gfx/qcms/qcmstypes.h
--- a/gfx/qcms/iccread.c
+++ b/gfx/qcms/iccread.c
@@ -30,16 +30,20 @@ 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/qcmsint.h
+++ b/gfx/qcms/qcmsint.h
@@ -1,9 +1,8 @@
-#include <stdlib.h>
 #include "qcms.h"
 #include "qcmstypes.h"
 
 /* used as a 16bit lookup table for the output transformation.
  * we refcount them so we only need to have one around per output
  * profile, instead of duplicating them per transform */
 struct precache_output
 {
--- a/gfx/qcms/qcmstypes.h
+++ b/gfx/qcms/qcmstypes.h
@@ -8,17 +8,23 @@
 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>
+#else
 typedef PRUptrdiff uintptr_t;
+#endif
 
 #else
 
 #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;