merge from gcc
This commit is contained in:
parent
7283eb8605
commit
8a423cb3d6
@ -1,3 +1,7 @@
|
|||||||
|
2001-08-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||||
|
|
||||||
|
* ansidecl.h (VA_OPEN, VA_CLOSE): Allow multiple uses.
|
||||||
|
|
||||||
2001-08-25 Nick Clifton <nickc@cambridge.redhat.com>
|
2001-08-25 Nick Clifton <nickc@cambridge.redhat.com>
|
||||||
|
|
||||||
* bfdlink.h (struct bfd_link_info): Change 'spare_dynamic_tags' to
|
* bfdlink.h (struct bfd_link_info): Change 'spare_dynamic_tags' to
|
||||||
|
@ -152,8 +152,8 @@ So instead we use the macro below and test it against specific values. */
|
|||||||
/* "struct Qdmy" swallows the semicolon after VA_OPEN/VA_FIXEDARG's
|
/* "struct Qdmy" swallows the semicolon after VA_OPEN/VA_FIXEDARG's
|
||||||
use without inhibiting further decls and without declaring an
|
use without inhibiting further decls and without declaring an
|
||||||
actual variable. */
|
actual variable. */
|
||||||
#define VA_OPEN(AP, VAR) va_list AP; va_start(AP, VAR); { struct Qdmy
|
#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP, VAR); { struct Qdmy
|
||||||
#define VA_CLOSE(AP) } va_end(AP)
|
#define VA_CLOSE(AP) } va_end(AP); }
|
||||||
#define VA_FIXEDARG(AP, T, N) struct Qdmy
|
#define VA_FIXEDARG(AP, T, N) struct Qdmy
|
||||||
|
|
||||||
#undef const
|
#undef const
|
||||||
@ -199,8 +199,8 @@ So instead we use the macro below and test it against specific values. */
|
|||||||
#define VPARAMS(args) (va_alist) va_dcl
|
#define VPARAMS(args) (va_alist) va_dcl
|
||||||
#define VA_START(va_list, var) va_start(va_list)
|
#define VA_START(va_list, var) va_start(va_list)
|
||||||
|
|
||||||
#define VA_OPEN(AP, VAR) va_list AP; va_start(AP); { struct Qdmy
|
#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP); { struct Qdmy
|
||||||
#define VA_CLOSE(AP) } va_end(AP)
|
#define VA_CLOSE(AP) } va_end(AP); }
|
||||||
#define VA_FIXEDARG(AP, TYPE, NAME) TYPE NAME = va_arg(AP, TYPE)
|
#define VA_FIXEDARG(AP, TYPE, NAME) TYPE NAME = va_arg(AP, TYPE)
|
||||||
|
|
||||||
/* some systems define these in header files for non-ansi mode */
|
/* some systems define these in header files for non-ansi mode */
|
||||||
|
@ -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>
|
2001-08-23 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
* regex.c (truncate_wchar): Use wcrtomb not wctomb.
|
* regex.c (truncate_wchar): Use wcrtomb not wctomb.
|
||||||
|
@ -74,48 +74,29 @@ NOTES
|
|||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
/* VARARGS */
|
|
||||||
#ifdef ANSI_PROTOTYPES
|
|
||||||
char *
|
char *
|
||||||
concat (const char *first, ...)
|
concat VPARAMS ((const char *first, ...))
|
||||||
#else
|
|
||||||
char *
|
|
||||||
concat (va_alist)
|
|
||||||
va_dcl
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
register size_t length;
|
register size_t length;
|
||||||
register char *newstr;
|
register char *newstr;
|
||||||
register char *end;
|
register char *end;
|
||||||
register const char *arg;
|
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. */
|
/* First compute the size of the result and get sufficient memory. */
|
||||||
#ifdef ANSI_PROTOTYPES
|
VA_OPEN (args, first);
|
||||||
va_start (args, first);
|
VA_FIXEDARG (args, const char *, first);
|
||||||
#else
|
|
||||||
va_start (args);
|
|
||||||
first = va_arg (args, const char *);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
length = 0;
|
length = 0;
|
||||||
for (arg = first; arg ; arg = va_arg (args, const char *))
|
for (arg = first; arg ; arg = va_arg (args, const char *))
|
||||||
length += strlen (arg);
|
length += strlen (arg);
|
||||||
|
|
||||||
va_end (args);
|
VA_CLOSE (args);
|
||||||
|
|
||||||
newstr = (char *) xmalloc (length + 1);
|
newstr = (char *) xmalloc (length + 1);
|
||||||
|
|
||||||
/* Now copy the individual pieces to the result string. */
|
/* Now copy the individual pieces to the result string. */
|
||||||
#ifdef ANSI_PROTOTYPES
|
VA_OPEN (args, first);
|
||||||
va_start (args, first);
|
VA_FIXEDARG (args, const char *, first);
|
||||||
#else
|
|
||||||
va_start (args);
|
|
||||||
first = va_arg (args, const char *);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
end = newstr;
|
end = newstr;
|
||||||
for (arg = first; arg ; arg = va_arg (args, const char *))
|
for (arg = first; arg ; arg = va_arg (args, const char *))
|
||||||
@ -125,7 +106,7 @@ concat (va_alist)
|
|||||||
end += length;
|
end += length;
|
||||||
}
|
}
|
||||||
*end = '\000';
|
*end = '\000';
|
||||||
va_end (args);
|
VA_CLOSE (args);
|
||||||
|
|
||||||
return newstr;
|
return newstr;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user