[SCM] libzen/master: Use AC_TRY_COMPILE instead for checking NEED_SIZET

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


The following commit has been merged in the master branch:
commit 0d7aae06aea93a384b9cabc4e41088257d6659d6
Author: Chow Loong Jin <hyperair at debian.org>
Date:   Mon Jan 23 11:41:06 2012 +0800

    Use AC_TRY_COMPILE instead for checking NEED_SIZET

diff --git a/debian/patches/0003-Amend-conditions-for-NEED_SIZET.patch b/debian/patches/0003-Amend-conditions-for-NEED_SIZET.patch
index 8bcd4b1..9eb2b39 100644
--- a/debian/patches/0003-Amend-conditions-for-NEED_SIZET.patch
+++ b/debian/patches/0003-Amend-conditions-for-NEED_SIZET.patch
@@ -11,10 +11,10 @@ Also detect the case where size_t is typedefed as unsigned int instead of
 unsigned long before defining NEED_SIZET
 ---
  Project/GNU/Library/Makefile.am  |    5 ++++-
- Project/GNU/Library/configure.ac |    9 +++++++++
+ Project/GNU/Library/configure.ac |   10 ++++++++++
  Project/GNU/Library/libzen.pc.in |    2 +-
  Source/ZenLib/Conf.h             |    6 +++++-
- 4 files changed, 19 insertions(+), 3 deletions(-)
+ 4 files changed, 20 insertions(+), 3 deletions(-)
 
 diff --git a/Project/GNU/Library/Makefile.am b/Project/GNU/Library/Makefile.am
 index 208a210..4266d22 100755
@@ -30,26 +30,20 @@ index 208a210..4266d22 100755
 +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
+index d8dc56b..15c1cfd 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
+@@ -190,6 +190,16 @@ 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_LANG([C++])
++AC_COMPILE_IFELSE([
++    #include <cstdlib>
++    void foo(signed int) {}
++    void foo(unsigned int) {}
++    int main () {foo(size_t(0));}], [AC_DEFINE([SIZET_IS_ULONG], [1], [size_t is unsigned long])], [])
 +
 +AC_CONFIG_HEADERS([libzenconfig.h])
 +
@@ -57,7 +51,7 @@ index d8dc56b..914166b 100755
  dnl External libs
  dnl
 diff --git a/Project/GNU/Library/libzen.pc.in b/Project/GNU/Library/libzen.pc.in
-index 12278f6..205ad81 100755
+index 12278f6..84fec22 100755
 --- a/Project/GNU/Library/libzen.pc.in
 +++ b/Project/GNU/Library/libzen.pc.in
 @@ -10,5 +10,5 @@ Name: libzen
@@ -68,7 +62,7 @@ index 12278f6..205ad81 100755
 +Cflags: -I${includedir} -I${libdir}/libzen/include
  Requires: tinyxml
 diff --git a/Source/ZenLib/Conf.h b/Source/ZenLib/Conf.h
-index a3d6b07..007c551 100755
+index a3d6b07..04de8ef 100755
 --- a/Source/ZenLib/Conf.h
 +++ b/Source/ZenLib/Conf.h
 @@ -23,6 +23,9 @@
@@ -87,7 +81,7 @@ index a3d6b07..007c551 100755
  //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) && defined(SIZET_IS_ULONG))
++#if ((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