lib/printf: rename & private __find_arguments

These are internal to printf(), and symbols starting with __ are
reserved for the compiler/libc.

Signed-off-by: David Lamparter <equinox@diac24.net>
This commit is contained in:
David Lamparter 2019-05-12 22:39:59 +02:00
parent e8c672ea81
commit 8be3678a23
5 changed files with 18 additions and 16 deletions

View File

@ -50,6 +50,16 @@ extern "C" {
#endif
#endif
#if !defined(__GNUC__)
#error module code needs GCC visibility extensions
#elif __GNUC__ < 4
#error module code needs GCC visibility extensions
#else
# define DSO_PUBLIC __attribute__ ((visibility ("default")))
# define DSO_SELF __attribute__ ((visibility ("protected")))
# define DSO_LOCAL __attribute__ ((visibility ("hidden")))
#endif
#ifdef __sun
/* Solaris doesn't do constructor priorities due to linker restrictions */
#undef _CONSTRUCTOR

View File

@ -24,16 +24,6 @@
extern "C" {
#endif
#if !defined(__GNUC__)
#error module code needs GCC visibility extensions
#elif __GNUC__ < 4
#error module code needs GCC visibility extensions
#else
# define DSO_PUBLIC __attribute__ ((visibility ("default")))
# define DSO_SELF __attribute__ ((visibility ("protected")))
# define DSO_LOCAL __attribute__ ((visibility ("hidden")))
#endif
struct frrmod_runtime;
struct frrmod_info {

View File

@ -250,7 +250,7 @@ addwaster(struct typetable *types, wchar_t **fmtp)
* Returns 0 on success. On failure, returns nonzero and sets errno.
*/
int
__find_arguments (const char *fmt0, va_list ap, union arg **argtable)
_frr_find_arguments (const char *fmt0, va_list ap, union arg **argtable)
{
char *fmt; /* format string */
int ch; /* character from fmt */
@ -442,7 +442,7 @@ error:
#ifdef WCHAR_SUPPORT
/* wchar version of __find_arguments. */
int
__find_warguments (const wchar_t *fmt0, va_list ap, union arg **argtable)
_frr_find_warguments (const wchar_t *fmt0, va_list ap, union arg **argtable)
{
wchar_t *fmt; /* format string */
wchar_t ch; /* character from fmt */

View File

@ -34,6 +34,8 @@
* $FreeBSD$
*/
#include "compiler.h"
/*
* Flags used during conversion.
*/
@ -92,7 +94,7 @@ union arg {
};
/* Handle positional parameters. */
int __find_arguments(const char *, va_list, union arg **);
int _frr_find_arguments(const char *, va_list, union arg **) DSO_LOCAL;
#ifdef WCHAR_SUPPORT
int __find_warguments(const wchar_t *, va_list, union arg **);
int _frr_find_warguments(const wchar_t *, va_list, union arg **) DSO_LOCAL;
#endif

View File

@ -253,7 +253,7 @@ __vfprintf(FILE *fp, const char *fmt0, va_list ap)
int hold = nextarg; \
if (argtable == NULL) { \
argtable = statargtable; \
if (__find_arguments (fmt0, orgap, &argtable)) { \
if (_frr_find_arguments (fmt0, orgap, &argtable)) { \
ret = EOF; \
goto error; \
} \
@ -369,7 +369,7 @@ reswitch: switch (ch) {
nextarg = n;
if (argtable == NULL) {
argtable = statargtable;
if (__find_arguments (fmt0, orgap,
if (_frr_find_arguments (fmt0, orgap,
&argtable)) {
ret = EOF;
goto error;