]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib/printf: rename & private __find_arguments
authorDavid Lamparter <equinox@diac24.net>
Sun, 12 May 2019 20:39:59 +0000 (22:39 +0200)
committerDavid Lamparter <equinox@diac24.net>
Mon, 3 Jun 2019 14:44:32 +0000 (16:44 +0200)
These are internal to printf(), and symbols starting with __ are
reserved for the compiler/libc.

Signed-off-by: David Lamparter <equinox@diac24.net>
lib/compiler.h
lib/module.h
lib/printf/printf-pos.c
lib/printf/printflocal.h
lib/printf/vfprintf.c

index c2e57db7f81af1e60780c4baeac45c166b644d44..750942822026e64947d45aa33257bf187f77e0b3 100644 (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
index c5f96db85b0511ca78b88d2c82ed9e34f340ab41..79cf52d75aa6a74529427152578debc300a0f757 100644 (file)
 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 {
index c66f4d1a06180a64cb76105fe3c57dd5a75e3ffe..a461a2be9a30b1398aa420df11778173877c43b9 100644 (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 */
index 5860c5c04e3ae4b754f5af050dafb432acedf99f..a2de161130bec45a65b361c02c8aeed5c25ef6f2 100644 (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
index 7374a03e73b97b9875269d10e9f0499bad4aec2a..66cedcb6986d79e13b8a5b8ddbb6756c8da61a16 100644 (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;