2009-04-09 09:10:49 -04:00
|
|
|
$OpenBSD: patch-include_lcms_h,v 1.8 2009/04/09 13:10:49 jasper Exp $
|
|
|
|
--- include/lcms.h.orig Thu Apr 9 13:56:40 2009
|
|
|
|
+++ include/lcms.h Thu Apr 9 13:59:19 2009
|
2008-07-19 07:18:23 -04:00
|
|
|
@@ -143,17 +143,17 @@ typedef pthread_rwlock_t LCMS_RWLOCK_T;
|
|
|
|
# define USE_BIG_ENDIAN 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
-#if TARGET_CPU_PPC
|
|
|
|
+#if defined(TARGET_CPU_PPC) && TARGET_CPU_PPC
|
|
|
|
# define USE_BIG_ENDIAN 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
-#if macintosh
|
|
|
|
+#if defined(macintosh) && macintosh
|
|
|
|
# ifndef __LITTLE_ENDIAN__
|
|
|
|
# define USE_BIG_ENDIAN 1
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2009-04-09 09:10:49 -04:00
|
|
|
-#ifdef __BIG_ENDIAN__
|
2008-07-19 07:18:23 -04:00
|
|
|
+#if defined(__BIG_ENDIAN__) && __BIG_ENDIAN__
|
|
|
|
# define USE_BIG_ENDIAN 1
|
|
|
|
#endif
|
|
|
|
|
2009-04-09 09:10:49 -04:00
|
|
|
@@ -1415,7 +1415,6 @@ LCMS_INLINE WORD _cmsClampWord(int in)
|
2008-07-19 07:18:23 -04:00
|
|
|
LCMS_INLINE void* _cmsMalloc(size_t size)
|
|
|
|
{
|
|
|
|
if (size > ((size_t) 1024*1024*500)) return NULL; // Never allow over 500Mb
|
|
|
|
- if (size < 0) return NULL; // Prevent signed size_t exploits
|
|
|
|
|
|
|
|
return (void*) malloc(size);
|
|
|
|
}
|