[Kde-imaging] [Bug 225407] New: [patch] dngconverter fix endian detection
Mark Purcell
msp at debian.org
Wed Feb 3 16:55:08 CET 2010
https://bugs.kde.org/show_bug.cgi?id=225407
Summary: [patch] dngconverter fix endian detection
Product: kipiplugins
Version: unspecified
Platform: unspecified
OS/Version: Linux
Status: UNCONFIRMED
Severity: normal
Priority: NOR
Component: DngConverter
AssignedTo: kde-imaging at kde.org
ReportedBy: msp at debian.org
Version: unknown (using 4.3.4 (KDE 4.3.4), Debian packages)
Compiler: cc
OS: Linux (i686) release 2.6.32-trunk-686
Find enclosed the patch Debian has been included to fix endian detection in
dngconverter.
Mark
http://patch-tracker.debian.org/patch/series/view/kipi-plugins/1.0.0-1/fix_endian_detection.diff
--- a/dngconverter/dngwriter/extra/dng_sdk/dng_flags.h
+++ b/dngconverter/dngwriter/extra/dng_sdk/dng_flags.h
@@ -65,57 +65,28 @@
/// \def qDNGBigEndian 1 if this target platform is big endian (e.g. PowerPC
Macintosh), else 0
/// \def qDNGLittleEndian 1 if this target platform is little endian (e.g. x86
processors), else 0
-#ifndef qDNGBigEndian
+#if !defined(qDNGBigEndian)
-#if defined(qDNGLittleEndian)
-#define qDNGBigEndian !qDNGLittleEndian
+#include <endian.h>
-#elif defined(__hppa__)
-#define qDNGBigEndian 1
-
-#elif defined(__sparc__)
-#define qDNGBigEndian 1
-
-#elif defined(__s390x__)
-#define qDNGBigEndian 1
-
-#elif defined(__s390__)
-#define qDNGBigEndian 1
-
-#elif defined(__POWERPC__)
-#define qDNGBigEndian 1
-
-#elif defined(__INTEL__)
+#if __BYTE_ORDER == __LITTLE_ENDIAN
#define qDNGBigEndian 0
-#elif defined(_M_IX86)
-#define qDNGBigEndian 0
-
-#elif defined(_M_X64)
-#define qDNGBigEndian 0
-
-#elif defined(__LITTLE_ENDIAN__)
-#define qDNGBigEndian 0
-
-#elif defined(__BIG_ENDIAN__)
+#elif __BYTE_ORDER == __BIG_ENDIAN
#define qDNGBigEndian 1
#else
-#ifndef qXCodeRez
#error Unable to figure out byte order.
-#endif
#endif
-#endif
-#ifndef qXCodeRez
+#endif
-#ifndef qDNGLittleEndian
+#if !defined(qDNGLittleEndian)
#define qDNGLittleEndian !qDNGBigEndian
#endif
-#endif
/*****************************************************************************/
--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Kde-imaging
mailing list