[SCM] libzen/master: Fix NEED_SIZET patch to avoid 32-bit breakage

hyperair at users.alioth.debian.org hyperair at users.alioth.debian.org
Thu Jan 26 08:40:27 UTC 2012


The following commit has been merged in the master branch:
commit 75c61351a8f01352f0b1f39af52bb8050d0687aa
Author: Chow Loong Jin <hyperair at debian.org>
Date:   Sun Jan 22 12:27:57 2012 +0800

    Fix NEED_SIZET patch to avoid 32-bit breakage
    
    Thanks: Peter Green
    Closes: #656717

diff --git a/debian/patches/0003-Amend-conditions-for-NEED_SIZET.patch b/debian/patches/0003-Amend-conditions-for-NEED_SIZET.patch
index 766a83b..8bcd4b1 100644
--- a/debian/patches/0003-Amend-conditions-for-NEED_SIZET.patch
+++ b/debian/patches/0003-Amend-conditions-for-NEED_SIZET.patch
@@ -6,21 +6,88 @@ When size_t is an unsigned int, and unsigned int and unsigned long have the same
 size, int32u gets defined as unsigned int. However, unsigned long/size_t is
 still treated as distinct from unsigned int by the compiler, and as such a
 size_t overload is needed.
+
+Also detect the case where size_t is typedefed as unsigned int instead of
+unsigned long before defining NEED_SIZET
 ---
- Source/ZenLib/Conf.h |    3 ++-
- 1 files changed, 2 insertions(+), 1 deletions(-)
+ Project/GNU/Library/Makefile.am  |    5 ++++-
+ Project/GNU/Library/configure.ac |    9 +++++++++
+ Project/GNU/Library/libzen.pc.in |    2 +-
+ Source/ZenLib/Conf.h             |    6 +++++-
+ 4 files changed, 19 insertions(+), 3 deletions(-)
 
+diff --git a/Project/GNU/Library/Makefile.am b/Project/GNU/Library/Makefile.am
+index 208a210..4266d22 100755
+--- a/Project/GNU/Library/Makefile.am
++++ b/Project/GNU/Library/Makefile.am
+@@ -28,4 +28,7 @@ libzen_la_SOURCES = \
+ 
+ libzen_la_LDFLAGS     = -no-undefined -version-info 0:0:0
+ 
+-INCLUDES = -I../../../Source
++INCLUDES = -I../../../Source -I.
++
++archincludedir = $(libdir)/libzen/include/
++archinclude_HEADERS = libzenconfig.h
+diff --git a/Project/GNU/Library/configure.ac b/Project/GNU/Library/configure.ac
+index d8dc56b..914166b 100755
+--- a/Project/GNU/Library/configure.ac
++++ b/Project/GNU/Library/configure.ac
+@@ -24,6 +24,8 @@ CFLAGS="$CFLAGS"
+ CXXFLAGS="$CXXFLAGS"
+ AC_PROG_CC
+ AC_PROG_CXX
++AC_PROG_GREP
++AC_PROG_CPP
+ AC_DISABLE_SHARED
+ AC_LIBTOOL_WIN32_DLL
+ AC_PROG_LIBTOOL
+@@ -190,6 +192,13 @@ if test "$GXX" = yes ; then
+ 	fi
+ fi
+ 
++dnl Check if size_t is long
++if echo echo __SIZE_TYPE__ | $CPP -E - | $GREP -q "long"; then
++    AC_DEFINE([SIZET_IS_ULONG], [1], [size_t is unsigned long])
++fi
++
++AC_CONFIG_HEADERS([libzenconfig.h])
++
+ dnl -------------------------------------------------------------------------
+ dnl External libs
+ dnl
+diff --git a/Project/GNU/Library/libzen.pc.in b/Project/GNU/Library/libzen.pc.in
+index 12278f6..205ad81 100755
+--- a/Project/GNU/Library/libzen.pc.in
++++ b/Project/GNU/Library/libzen.pc.in
+@@ -10,5 +10,5 @@ Name: libzen
+ Version: @PACKAGE_VERSION@
+ Description: ZenLib
+ Libs: -L at libdir@ -lzen -lpthread
+-Cflags: -I${includedir}
++Cflags: -I${includedir} -I${libdir}/libzen/include
+ Requires: tinyxml
 diff --git a/Source/ZenLib/Conf.h b/Source/ZenLib/Conf.h
-index a3d6b07..9899548 100755
+index a3d6b07..007c551 100755
 --- a/Source/ZenLib/Conf.h
 +++ b/Source/ZenLib/Conf.h
-@@ -188,7 +188,8 @@
+@@ -23,6 +23,9 @@
+ //---------------------------------------------------------------------------
+ #ifndef ZenConfH
+ #define ZenConfH
++
++#include <libzenconfig.h>
++
+ //---------------------------------------------------------------------------
+ 
+ //***************************************************************************
+@@ -188,7 +191,8 @@
  #endif
  //---------------------------------------------------------------------------
  //If we need size_t specific integer conversion
 -#if defined(__LP64__) || defined(MACOSX)
 +#include <tr1/cstdint> //SIZE_MAX
-+#if defined(__LP64__) || defined(MACOSX) || ((SIZE_MAX == UINT_MAX) && (UINT_MAX == ULONG_MAX))
++#if defined(__LP64__) || defined(MACOSX) || ((SIZE_MAX == UINT_MAX) && (UINT_MAX == ULONG_MAX) && defined(SIZET_IS_ULONG))
      #define NEED_SIZET
  #endif
  

-- 
libzen packaging



More information about the pkg-multimedia-commits mailing list