* The installed ATerm 2.5 headers refer to SIZEOF_LONG etc., which are not set anywhere. This causes other packages to break on 64-bit platforms unless they happen to define those macros. So don't rely on them.

svn path=/nixpkgs/trunk/; revision=20194

+60
+4
pkgs/development/libraries/aterm/2.5.nix
··· 11 11 patches = [ 12 12 # Fix for http://bugzilla.sen.cwi.nl:8080/show_bug.cgi?id=841 13 13 ./max-long.patch 14 + 15 + # Patch the ATerm header files so that they don't rely on 16 + # SIZEOF_LONG, SIZEOF_INT and SIZEOF_VOID_P being set. 17 + ./sizeof.patch 14 18 ]; 15 19 16 20 doCheck = true;
+56
pkgs/development/libraries/aterm/sizeof.patch
··· 1 + diff -rc -x '*~' aterm-2.5-orig/aterm/aterm.c aterm-2.5/aterm/aterm.c 2 + *** aterm-2.5-orig/aterm/aterm.c 2007-02-27 23:41:31.000000000 +0100 3 + --- aterm-2.5/aterm/aterm.c 2010-02-23 15:10:38.000000000 +0100 4 + *************** 5 + *** 150,155 **** 6 + --- 150,157 ---- 7 + if (initialized) 8 + return; 9 + 10 + + assert(sizeof(long) == sizeof(void *)); 11 + + 12 + /*{{{ Handle arguments */ 13 + 14 + for (lcv=1; lcv < argc; lcv++) { 15 + diff -rc -x '*~' aterm-2.5-orig/aterm/encoding.h aterm-2.5/aterm/encoding.h 16 + *** aterm-2.5-orig/aterm/encoding.h 2007-02-27 23:41:31.000000000 +0100 17 + --- aterm-2.5/aterm/encoding.h 2010-02-23 15:36:05.000000000 +0100 18 + *************** 19 + *** 10,24 **** 20 + { 21 + #endif/* __cplusplus */ 22 + 23 + ! #if SIZEOF_LONG > 4 24 + ! #define AT_64BIT 25 + #endif 26 + 27 + ! #if SIZEOF_LONG != SIZEOF_VOID_P 28 + ! #error Size of long is not the same as the size of a pointer 29 + #endif 30 + 31 + ! #if SIZEOF_INT > 4 32 + #error Size of int is not 32 bits 33 + #endif 34 + 35 + --- 10,30 ---- 36 + { 37 + #endif/* __cplusplus */ 38 + 39 + ! #include <limits.h> 40 + ! 41 + ! #ifndef SIZEOF_LONG 42 + ! #if ULONG_MAX > 4294967295 43 + ! #define SIZEOF_LONG 8 44 + ! #else 45 + ! #define SIZEOF_LONG 4 46 + ! #endif 47 + #endif 48 + 49 + ! #if SIZEOF_LONG > 4 50 + ! #define AT_64BIT 51 + #endif 52 + 53 + ! #if UINT_MAX > 4294967295 54 + #error Size of int is not 32 bits 55 + #endif 56 +