From: Peter O'Gorman Date: Tue, 26 Aug 2008 17:41:25 +0000 (-0500) Subject: Remove unnecessary global argz functions. X-Git-Tag: v2.2.6~9 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=300fa580c49003080ae9c65a64821c790a44fac0;p=thirdparty%2Flibtool.git 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. --- diff --git a/ChangeLog b/ChangeLog index 13cc2af83..48b8e5a95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-08-26 Peter O'Gorman , + Ralf Wildenhues + + 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 Initial support for Lahey Fortran on GNU/Linux. diff --git a/Makefile.am b/Makefile.am index 0085c7f42..1417e8428 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 e0d1062e4..c85f74141 100644 --- 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: diff --git a/libltdl/argz.c b/libltdl/argz.c index f31ce176c..8567723bf 100644 --- a/libltdl/argz.c +++ b/libltdl/argz.c @@ -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; -} diff --git a/libltdl/argz_.h b/libltdl/argz_.h index 40d51767a..05575753d 100644 --- a/libltdl/argz_.h +++ b/libltdl/argz_.h @@ -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 index 000000000..465a51383 --- /dev/null +++ b/tests/ltdl-api.at @@ -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