]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Remove unnecessary global argz functions.
authorPeter O'Gorman <peter@pogma.com>
Tue, 26 Aug 2008 17:41:25 +0000 (12:41 -0500)
committerPeter O'Gorman <peter@pogma.com>
Tue, 26 Aug 2008 17:41:25 +0000 (12:41 -0500)
* libltdl/argz.c (argz_add,argz_count): Remove.
* libltdl/argz_.h (argz_add,argz_count): Remove.
* NEWS: Announce it.
* tests/ltdl-api.at: Test so we don't repeat it.
* Makefile.am: Add new test.

ChangeLog
Makefile.am
NEWS
libltdl/argz.c
libltdl/argz_.h
tests/ltdl-api.at [new file with mode: 0644]

index 13cc2af83a8810e2052b0bb5f3e92b55f7b82d34..48b8e5a9550f413fe54866ab7e07bfb0ff75155d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-08-26  Peter O'Gorman  <peter@pogma.com>,
+           Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Remove unnecessary global argz functions.
+       * libltdl/argz.c (argz_add,argz_count): Remove.
+       * libltdl/argz_.h (argz_add,argz_count): Remove.
+       * NEWS: Announce it.
+       * tests/ltdl-api.at: Test so we don't repeat it.
+       * Makefile.am: Add new test.
+
 2008-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Initial support for Lahey Fortran on GNU/Linux.
index 0085c7f427f632e1a4ea9bcd563486461b54d541..1417e842870e6abc4eb58d90a74847b4a8b0bd2c 100644 (file)
@@ -454,6 +454,7 @@ TESTSUITE_AT        = tests/testsuite.at \
                  tests/am-subdir.at \
                  tests/lt_dlexit.at \
                  tests/lt_dladvise.at \
+                 tests/ltdl-api.at \
                  tests/need_lib_prefix.at \
                  tests/standalone.at \
                  tests/subproject.at \
diff --git a/NEWS b/NEWS
index e0d1062e4923c13c1dd5a433365f0f307d27d7db..c85f7414188df8a2c5a85c117660fa6a7ea2e0cd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,9 @@ New in 2.2.??: 2008-08-??: git version 2.2.5a, Libtool team:
 
   - Several testsuite issues have been fixed, thanks to user feedback.
 
+  - Fix 2.2 regression that caused argz symbols to be exported from
+    libltdl unrenamed on systems that do not have working argz.
+
 New in 2.2.4: 2008-05-04: git version 2.2.3a, Libtool team:
 
 * New features:
index f31ce176c4a417a34f45e6c62f623ed2aed0e4cf..8567723bfd5fce190e25c25a2da9ef504b00622c 100644 (file)
@@ -76,14 +76,6 @@ argz_append (char **pargz, size_t *pargz_len, const char *buf, size_t buf_len)
 }
 
 
-/* Add a string to the argz vector.  */
-error_t
-argz_add (char **pargz, size_t *pargz_len, const char *str)
-{
-  return argz_append (pargz, pargz_len, str, strlen (str) + 1);
-}
-
-
 error_t
 argz_create_sep (const char *str, int delim, char **pargz, size_t *pargz_len)
 {
@@ -232,23 +224,3 @@ argz_stringify (char *argz, size_t argz_len, int sep)
     }
 }
 
-
-/* Count number of elements (null bytes) in argz vector.  */
-
-size_t
-argz_count (const char *argz, size_t argz_len)
-{
-  size_t count = 0;
-
-  assert ((argz && argz_len) || (!argz && !argz_len));
-
-  while (argz_len > 0)
-    {
-      size_t part_len = strlen (argz);
-      argz += part_len + 1;
-      argz_len -= part_len + 1;
-      count++;
-    }
-
-  return count;
-}
index 40d51767aa3987ad7ed758a49806385e1591e0bf..05575753d54d8159cabb95f8d97874512eadff8f 100644 (file)
@@ -49,8 +49,6 @@ extern "C" {
 
 LT_SCOPE error_t argz_append   (char **pargz, size_t *pargz_len,
                                 const char *buf, size_t buf_len);
-LT_SCOPE error_t argz_add       (char **pargz, size_t *pargz_len,
-                                 const char *str);
 LT_SCOPE error_t argz_create_sep(const char *str, int delim,
                                 char **pargz, size_t *pargz_len);
 LT_SCOPE error_t argz_insert   (char **pargz, size_t *pargz_len,
@@ -58,7 +56,6 @@ LT_SCOPE error_t argz_insert  (char **pargz, size_t *pargz_len,
 LT_SCOPE char *         argz_next      (char *argz, size_t argz_len,
                                 const char *entry);
 LT_SCOPE void   argz_stringify (char *argz, size_t argz_len, int sep);
-LT_SCOPE size_t  argz_count     (const char *argz, size_t argz_len);
 
 #if defined(__cplusplus)
 }
diff --git a/tests/ltdl-api.at b/tests/ltdl-api.at
new file mode 100644 (file)
index 0000000..465a513
--- /dev/null
@@ -0,0 +1,39 @@
+# ltdl-api.at -- test libltdl API                -*- Autotest -*-
+#
+#   Copyright (C) 2008 Free Software Foundation, Inc.
+#   Written by Ralf Wildenhues, 2008.
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from  http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+####
+
+AT_SETUP([ltdl API])
+AT_KEYWORDS([libltdl])
+
+# Ensure that no symbols from argz are unrenamed.
+eval `$LIBTOOL --config | $EGREP '^(NM|global_symbol_pipe|objext)='`
+argz_o=$abs_top_builddir/libltdl/argz.$objext
+AT_CHECK([test -f "$argz_o" || exit 77])
+AT_CHECK([eval "$NM \"\$argz_o\" | $global_symbol_pipe"],
+        [], [stdout], [ignore])
+# Check for global symbols beginning with "argz_"
+AT_CHECK([grep "^T argz_" stdout], [1])
+# and also for the _ prefixed version "_argz_"
+AT_CHECK([grep "^T _argz_" stdout], [1])
+
+AT_CLEANUP