summaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorDJ Delorie <dj@delorie.com>2001-08-27 20:05:03 +0000
committerDJ Delorie <dj@delorie.com>2001-08-27 20:05:03 +0000
commit039a0a12de76b9aa7c1a99de786798b62374a047 (patch)
tree85f46261078ff94e7198983a11ad5cae170f4d5b /libiberty
parent24ae4910e19f284cb621418cf06d70f2833190de (diff)
downloadgdb-039a0a12de76b9aa7c1a99de786798b62374a047.tar.gz
merge from gcc
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog4
-rw-r--r--libiberty/concat.c35
2 files changed, 12 insertions, 27 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index dab5db8ca9a..b4866cfaf8f 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,7 @@
+2001-08-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * concat.c (concat): Use VPARAMS, VA_OPEN, VA_FIXEDARG & VA_CLOSE.
+
2001-08-23 Ulrich Drepper <drepper@redhat.com>
* regex.c (truncate_wchar): Use wcrtomb not wctomb.
diff --git a/libiberty/concat.c b/libiberty/concat.c
index 01270eadcf2..2e31e833f4d 100644
--- a/libiberty/concat.c
+++ b/libiberty/concat.c
@@ -74,48 +74,29 @@ NOTES
# endif
# endif
-/* VARARGS */
-#ifdef ANSI_PROTOTYPES
-char *
-concat (const char *first, ...)
-#else
char *
-concat (va_alist)
- va_dcl
-#endif
+concat VPARAMS ((const char *first, ...))
{
register size_t length;
register char *newstr;
register char *end;
register const char *arg;
- va_list args;
-#ifndef ANSI_PROTOTYPES
- const char *first;
-#endif
/* First compute the size of the result and get sufficient memory. */
-#ifdef ANSI_PROTOTYPES
- va_start (args, first);
-#else
- va_start (args);
- first = va_arg (args, const char *);
-#endif
-
+ VA_OPEN (args, first);
+ VA_FIXEDARG (args, const char *, first);
+
length = 0;
for (arg = first; arg ; arg = va_arg (args, const char *))
length += strlen (arg);
- va_end (args);
+ VA_CLOSE (args);
newstr = (char *) xmalloc (length + 1);
/* Now copy the individual pieces to the result string. */
-#ifdef ANSI_PROTOTYPES
- va_start (args, first);
-#else
- va_start (args);
- first = va_arg (args, const char *);
-#endif
+ VA_OPEN (args, first);
+ VA_FIXEDARG (args, const char *, first);
end = newstr;
for (arg = first; arg ; arg = va_arg (args, const char *))
@@ -125,7 +106,7 @@ concat (va_alist)
end += length;
}
*end = '\000';
- va_end (args);
+ VA_CLOSE (args);
return newstr;
}