~ubuntu-branches/ubuntu/quantal/zeroc-ice/quantal

« back to all changes in this revision

Viewing changes to debian/patches.old/10-endian-wordsize.patch

  • Committer: Bazaar Package Importer
  • Author(s): Cleto Martin Angelina
  • Date: 2011-04-25 18:44:24 UTC
  • mfrom: (6.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110425184424-sep9i9euu434vq4c
Tags: 3.4.1-7
* Bug fix: "libdb5.1-java.jar was renamed to db.jar", thanks to Ondřej
  Surý (Closes: #623555).
* Bug fix: "causes noise in php5", thanks to Jayen Ashar (Closes:
  #623533).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Unfortunately __WORDSIZE is not portable.  In GCC it is even defined
 
2
on different places depending on the version. If you have a better patch 
 
3
just tell me.
 
4
 
 
5
This patch is based on suggestions from Siim Poder on bug #551074.
 
6
 
 
7
diff -Nur -x '*.orig' -x '*~' zeroc-ice/cpp/include/IceUtil/Config.h zeroc-ice.new/cpp/include/IceUtil/Config.h
 
8
--- zeroc-ice/cpp/include/IceUtil/Config.h      2009-03-29 11:06:23.035074259 +0200
 
9
+++ zeroc-ice.new/cpp/include/IceUtil/Config.h  2009-10-18 19:52:40.714084622 +0200
 
10
@@ -16,7 +16,19 @@
 
11
 // Most CPUs support only one endianness, with the notable exceptions
 
12
 // of Itanium (IA64) and MIPS.
 
13
 //
 
14
-#if defined(__i386)     || defined(_M_IX86) || defined(__x86_64)  || \
 
15
+#if defined(HAVE_ENDIAN_H)
 
16
+#   include <endian.h>
 
17
+#   if __BYTE_ORDER==__LITTLE_ENDIAN
 
18
+#      define ICE_LITTLE_ENDIAN
 
19
+#   elif __BYTE_ORDER==__BIG_ENDIAN
 
20
+#      define ICE_BIG_ENDIAN
 
21
+#   else
 
22
+#      error "Unknown endian type"
 
23
+#   endif
 
24
+#endif
 
25
+
 
26
+#if !defined(ICE_LITTLE_ENDIAN) && !defined(ICE_BIG_ENDIAN)
 
27
+#if defined(__i386)     || defined(_M_IX86) || defined(__x86_64)  || \
 
28
     defined(_M_X64)     || defined(_M_IA64) || defined(__alpha__) || \
 
29
     defined(__MIPSEL__)
 
30
 #   define ICE_LITTLE_ENDIAN
 
31
@@ -27,11 +39,23 @@
 
32
 #else
 
33
 #   error "Unknown architecture"
 
34
 #endif
 
35
+#endif
 
36
 
 
37
 //
 
38
 // 32 or 64 bit mode?
 
39
 //
 
40
-#if defined(__linux) && defined(__sparc__)
 
41
+#if defined(HAVE_LIMITS_H)
 
42
+#   include <stdint.h>
 
43
+#   include <limits.h>
 
44
+#   if __WORDSIZE == 64
 
45
+#      define ICE_64
 
46
+#   else
 
47
+#      define ICE_32
 
48
+#   endif
 
49
+#endif
 
50
+
 
51
+#if !defined(ICE_32) && !defined(ICE_64)
 
52
+#if defined(__linux) && defined(__sparc__)
 
53
 //
 
54
 // We are a linux sparc, which forces 32 bit usr land, no matter 
 
55
 // the architecture
 
56
@@ -47,6 +71,7 @@
 
57
 #else
 
58
 #   define ICE_32
 
59
 #endif
 
60
+#endif
 
61
 
 
62
 //
 
63
 // Compiler extensions to export and import symbols: see the documentation