summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2019-05-12 22:39:59 +0200
committerDavid Lamparter <equinox@diac24.net>2019-06-03 16:44:32 +0200
commit8be3678a2331250b0559d07526e66b73d1794d8c (patch)
treea4af45407a189a6d7ee0a03649ce3f070502e1e6
parente8c672ea8101c541f66e0959d526ae4f5a2a778d (diff)
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>
-rw-r--r--lib/compiler.h10
-rw-r--r--lib/module.h10
-rw-r--r--lib/printf/printf-pos.c4
-rw-r--r--lib/printf/printflocal.h6
-rw-r--r--lib/printf/vfprintf.c4
5 files changed, 18 insertions, 16 deletions
diff --git a/lib/compiler.h b/lib/compiler.h
index c2e57db7f8..7509428220 100644
--- a/lib/compiler.h
+++ b/lib/compiler.h
@@ -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
diff --git a/lib/module.h b/lib/module.h
index c5f96db85b..79cf52d75a 100644
--- a/lib/module.h
+++ b/lib/module.h
@@ -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 {
diff --git a/lib/printf/printf-pos.c b/lib/printf/printf-pos.c
index c66f4d1a06..a461a2be9a 100644
--- a/lib/printf/printf-pos.c
+++ b/lib/printf/printf-pos.c
@@ -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 */
diff --git a/lib/printf/printflocal.h b/lib/printf/printflocal.h
index 5860c5c04e..a2de161130 100644
--- a/lib/printf/printflocal.h
+++ b/lib/printf/printflocal.h
@@ -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
diff --git a/lib/printf/vfprintf.c b/lib/printf/vfprintf.c
index 7374a03e73..66cedcb698 100644
--- a/lib/printf/vfprintf.c
+++ b/lib/printf/vfprintf.c
@@ -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;