OSSP CVS Repository

ossp - Check-in [5226]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 5226
Date: 2005-Oct-03 11:04:05 (local)
2005-Oct-03 09:04:05 (UTC)
User:rse
Branch:
Comment: flush pending changes
Tickets:
Inspections:
Files:
ossp-pkg/sio/ChangeLog      1.5 -> 1.6     13 inserted, 2 deleted
ossp-pkg/sio/aclocal.m4      1.2 -> 1.3     109 inserted, 0 deleted
ossp-pkg/sio/configure.ac      1.4 -> 1.5     1 inserted, 0 deleted
ossp-pkg/sio/devtool.conf      1.7 -> 1.8     3 inserted, 3 deleted
ossp-pkg/sio/ts.c      1.2 -> 1.3     7 inserted, 7 deleted
ossp-pkg/sio/ts.h      1.1 -> 1.2     3 inserted, 3 deleted

ossp-pkg/sio/ChangeLog 1.5 -> 1.6

--- ChangeLog    2004/02/11 08:34:46     1.5
+++ ChangeLog    2005/10/03 09:04:05     1.6
@@ -11,9 +11,20 @@
   This is a list of all changes to OSSP sio.
   For a more brief summary please have a look at the NEWS file.
 
-  Changes between 0.9.2 and 0.9.3 (30-Jun-2003 to xx-Feb-2004)
+  Changes between 0.9.2 and 0.9.3 (30-Jun-2003 to 03-Oct-2005)
 
-   ...
+   *) Provide Autoconf check (AC_CHECK_VA_COPY) for va_copy(d,s) macro
+      and fallback implementations and now that we can be sure that
+      va_copy() exists for us, use it in var_formatv() and ts.c instead
+      of the direct assignments (which are not sufficiently portable).
+      [Ralf S. Engelschall <rse@engelschall.com>]
+
+   *) Upgraded build environment to GNU autoconf 2.59,
+      GNU libtool 1.5.20 and GNU shtool 2.0.3
+      [Ralf S. Engelschall <rse@engelschall.com>]
+
+   *) Upgraded to OSSP sa 1.2.6 and OSSP al 0.9.3
+      [Ralf S. Engelschall <rse@engelschall.com>]
 
    *) Fixed OSSP ex support by internally using a non-conflicting
       namespace for the OSSP ex API.


ossp-pkg/sio/aclocal.m4 1.2 -> 1.3

--- aclocal.m4   2003/01/06 19:04:56     1.2
+++ aclocal.m4   2005/10/03 09:04:05     1.3
@@ -226,3 +226,112 @@
 AC_MSG_RESULT([$with_$2])
 ])dnl
 
+dnl ##
+dnl ##  Check for C99 va_copy() implementation
+dnl ##  (and provide fallback implementation if neccessary)
+dnl ##
+dnl ##  configure.in:
+dnl ##    AC_CHECK_VA_COPY
+dnl ##  foo.c:
+dnl ##    #include "config.h"
+dnl ##    [...]
+dnl ##    va_copy(d,s)
+dnl ##
+dnl ##  This check is rather complex: first because we really have to
+dnl ##  try various possible implementations in sequence and second, we
+dnl ##  cannot define a macro in config.h with parameters directly.
+dnl ##
+
+dnl #   test program for va_copy() implementation
+changequote(<<,>>)
+m4_define(__va_copy_test, <<[
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#define DO_VA_COPY(d, s) $1
+void test(char *str, ...)
+{
+    va_list ap, ap2;
+    int i;
+    va_start(ap, str);
+    DO_VA_COPY(ap2, ap);
+    for (i = 1; i <= 9; i++) {
+        int k = (int)va_arg(ap, int);
+        if (k != i)
+            abort();
+    }
+    DO_VA_COPY(ap, ap2);
+    for (i = 1; i <= 9; i++) {
+        int k = (int)va_arg(ap, int);
+        if (k != i)
+            abort();
+    }
+    va_end(ap);
+}
+int main(int argc, char *argv[])
+{
+    test("test", 1, 2, 3, 4, 5, 6, 7, 8, 9);
+    exit(0);
+}
+]>>)
+changequote([,])
+
+dnl #   test driver for va_copy() implementation
+m4_define(__va_copy_check, [
+    AH_VERBATIM($1,
+[/* Predefined possible va_copy() implementation (id: $1) */
+#define __VA_COPY_USE_$1(d, s) $2])
+    if test ".$ac_cv_va_copy" = .; then
+        AC_TRY_RUN(__va_copy_test($2), [ac_cv_va_copy="$1"])
+    fi
+])
+
+dnl #   Autoconf check for va_copy() implementation checking
+AC_DEFUN(AC_CHECK_VA_COPY,[
+  dnl #   provide Autoconf display check message
+  AC_MSG_CHECKING(for va_copy() function)
+  dnl #   check for various implementations in priorized sequence   
+  AC_CACHE_VAL(ac_cv_va_copy, [
+    ac_cv_va_copy=""
+    dnl #   1. check for standardized C99 macro
+    __va_copy_check(C99, [va_copy((d), (s))])
+    dnl #   2. check for alternative/deprecated GCC macro
+    __va_copy_check(GCM, [VA_COPY((d), (s))])
+    dnl #   3. check for internal GCC macro (high-level define)
+    __va_copy_check(GCH, [__va_copy((d), (s))])
+    dnl #   4. check for internal GCC macro (built-in function)
+    __va_copy_check(GCB, [__builtin_va_copy((d), (s))])
+    dnl #   5. check for assignment approach (assuming va_list is a struct)
+    __va_copy_check(ASS, [do { (d) = (s); } while (0)])
+    dnl #   6. check for assignment approach (assuming va_list is a pointer)
+    __va_copy_check(ASP, [do { *(d) = *(s); } while (0)])
+    dnl #   7. check for memory copying approach (assuming va_list is a struct)
+    __va_copy_check(CPS, [memcpy((void *)&(d), (void *)&(s)), sizeof((s))])
+    dnl #   8. check for memory copying approach (assuming va_list is a pointer)
+    __va_copy_check(CPP, [memcpy((void *)(d), (void *)(s)), sizeof(*(s))])
+    if test ".$ac_cv_va_copy" = .; then
+        AC_ERROR([no working implementation found])
+    fi
+  ])
+  dnl #   optionally activate the fallback implementation
+  if test ".$ac_cv_va_copy" = ".C99"; then
+      AC_DEFINE(HAVE_VA_COPY, 1, [Define if va_copy() macro exists (and no fallback implementation is required)])
+  fi
+  dnl #   declare which fallback implementation to actually use
+  AC_DEFINE_UNQUOTED([__VA_COPY_USE], [__VA_COPY_USE_$ac_cv_va_copy],
+      [Define to id of used va_copy() implementation])
+  dnl #   provide activation hook for fallback implementation
+  AH_VERBATIM([__VA_COPY_ACTIVATION],
+[/* Optional va_copy() implementation activation */
+#ifndef HAVE_VA_COPY
+#define va_copy(d, s) __VA_COPY_USE(d, s)
+#endif
+])
+  dnl #   provide Autoconf display result message
+  if test ".$ac_cv_va_copy" = ".C99"; then
+      AC_MSG_RESULT([yes])
+  else
+      AC_MSG_RESULT([no (using fallback implementation)])
+  fi
+])
+


ossp-pkg/sio/configure.ac 1.4 -> 1.5

--- configure.ac 2003/01/20 15:34:13     1.4
+++ configure.ac 2005/10/03 09:04:05     1.5
@@ -37,6 +37,7 @@
 AC_PROG_MAKE_SET
 AC_PROG_CC
 AC_CHECK_DEBUGGING
+AC_CHECK_VA_COPY
 
 sinclude(libtool.m4)
 AC_PROG_LIBTOOL


ossp-pkg/sio/devtool.conf 1.7 -> 1.8

--- devtool.conf 2003/06/30 10:36:52     1.7
+++ devtool.conf 2005/10/03 09:04:05     1.8
@@ -10,9 +10,9 @@
     done
 
 %autogen
-    @autogen shtool   1.6.2 "1.6.*" all
-    @autogen libtool  1.5   "1.5*"
-    @autogen autoconf 2.57  "2.5[3-9]*"
+    @autogen shtool   2.0.3  "2.0.*" all
+    @autogen libtool  1.5.20 "1.5*"
+    @autogen autoconf 2.59   "2.5[3-9]*"
 
     for name in al sa; do
         echo "===> lib_${name} (devtool autogen)"


ossp-pkg/sio/ts.c 1.2 -> 1.3

--- ts.c 2003/02/06 13:44:23     1.2
+++ ts.c 2005/10/03 09:04:05     1.3
@@ -1,11 +1,11 @@
 /*
-**  TS - OSSP Test Suite Library
-**  Copyright (c) 2001-2002 Ralf S. Engelschall <rse@engelschall.com>
-**  Copyright (c) 2001-2002 The OSSP Project <http://www.ossp.org/>
-**  Copyright (c) 2001-2002 Cable & Wireless Deutschland <http://www.cw.com/de/>
+**  OSSP ts - Test Suite Library
+**  Copyright (c) 2001-2005 Ralf S. Engelschall <rse@engelschall.com>
+**  Copyright (c) 2001-2005 The OSSP Project <http://www.ossp.org/>
+**  Copyright (c) 2001-2005 Cable & Wireless <http://www.cw.com/>
 **
-**  This file is part of OSSP TS, a small test suite library which
-**  can be found at http://www.ossp.org/pkg/ts/.
+**  This file is part of OSSP ts, a small test suite library which
+**  can be found at http://www.ossp.org/pkg/lib/ts/.
 **
 **  Permission to use, copy, modify, and distribute this software for
 **  any purpose with or without fee is hereby granted, provided that
@@ -206,7 +206,7 @@
 
     if (format == NULL)
         return NULL;
-    ap2 = ap;
+    va_copy(ap2, ap);
     if ((n = ts_suite_mvxprintf(NULL, 0, format, ap)) == -1)
         return NULL;
     if ((buffer = (char *)malloc(n+1)) == NULL)


ossp-pkg/sio/ts.h 1.1 -> 1.2

--- ts.h 2002/12/18 15:52:33     1.1
+++ ts.h 2005/10/03 09:04:05     1.2
@@ -1,8 +1,8 @@
 /*
 **  TS - OSSP Test Suite Library
-**  Copyright (c) 2001-2002 Ralf S. Engelschall <rse@engelschall.com>
-**  Copyright (c) 2001-2002 The OSSP Project <http://www.ossp.org/>
-**  Copyright (c) 2001-2002 Cable & Wireless Deutschland <http://www.cw.com/de/>
+**  Copyright (c) 2001-2005 Ralf S. Engelschall <rse@engelschall.com>
+**  Copyright (c) 2001-2005 The OSSP Project <http://www.ossp.org/>
+**  Copyright (c) 2001-2005 Cable & Wireless <http://www.cw.com/>
 **
 **  This file is part of OSSP TS, a small test suite library which
 **  can be found at http://www.ossp.org/pkg/ts/.

CVSTrac 2.0.1