Bug 301027

Summary: Debian #670454 digikam: FTBFS on mips ("dng_flags.h error: #error Unable to figure out byte order.")
Product: [Applications] digikam Reporter: Mark Purcell <msp>
Component: Plugin-Bqm-DngConverterAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed In: 2.6.0

Description Mark Purcell 2012-06-02 04:52:06 UTC
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=670454


From: Modestas Vainius <modax@debian.org>
Subject: Improve big/little endian detection in dngconverter.
Origin: vendor

__BYTE_ORDER__ is a standard GNU C macro [1]. Neither of other checks passes on
s390 causing a FTBFS.

[1] http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html

--- a/extra/kipi-plugins/dngconverter/dngwriter/extra/dng_sdk/dng_flags.h
+++ b/extra/kipi-plugins/dngconverter/dngwriter/extra/dng_sdk/dng_flags.h
@@ -91,6 +91,14 @@
 #elif defined(__BIG_ENDIAN__)
 #define qDNGBigEndian 1
 
+#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && \
+    __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+#define qDNGBigEndian 1
+
+#elif defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \
+    __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+#define qDNGBigEndian 0
+
 #else
 
 #ifndef qXCodeRez
Comment 1 Andrew Goodbody 2012-06-02 09:25:16 UTC
Git commit af67dd5c98d4d8357940a53114dd97201752f9f6 by Andrew Goodbody.
Committed on 02/06/2012 at 09:18.
Pushed by goodbody into branch 'master'.

Fix FTBFS on mips

Add ability to detect byte order from __BYTE_ORDER__ macro if defined,
fixes fail to build on MIPS.

M  +8    -0    dngconverter/dngwriter/extra/dng_sdk/dng_flags.h

http://commits.kde.org/kipi-plugins/af67dd5c98d4d8357940a53114dd97201752f9f6