aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-04-09 12:35:13 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-04-09 12:35:13 +0000
commitf81e8dbc74186f34faa5ae2b0fe8bdc3f18114ae (patch)
tree91ee95914c2b9a07817bd6f596fc3df758651147
parent327fd47f362843fc62fbee6169904c416ca13d11 (diff)
downloadbusybox-w32-f81e8dbc74186f34faa5ae2b0fe8bdc3f18114ae.tar.gz
busybox-w32-f81e8dbc74186f34faa5ae2b0fe8bdc3f18114ae.tar.bz2
busybox-w32-f81e8dbc74186f34faa5ae2b0fe8bdc3f18114ae.zip
*: make "pragma GCC visibility push(hidden)" less ugly
-rw-r--r--coreutils/libcoreutils/coreutils.h10
-rw-r--r--e2fsprogs/e2fs_defs.h6
-rw-r--r--e2fsprogs/e2fs_lib.h8
-rw-r--r--e2fsprogs/old_e2fsprogs/blkid/blkid.h7
-rw-r--r--e2fsprogs/old_e2fsprogs/blkid/blkidP.h7
-rw-r--r--e2fsprogs/old_e2fsprogs/blkid/list.h4
-rw-r--r--e2fsprogs/old_e2fsprogs/blkid/probe.h5
-rw-r--r--e2fsprogs/old_e2fsprogs/e2fsbb.h6
-rw-r--r--e2fsprogs/old_e2fsprogs/ext2fs/ext2_fs.h7
-rw-r--r--e2fsprogs/old_e2fsprogs/ext2fs/ext2_io.h8
-rw-r--r--e2fsprogs/old_e2fsprogs/ext2fs/ext2fs.h7
-rw-r--r--e2fsprogs/old_e2fsprogs/ext2fs/kernel-jbd.h7
-rw-r--r--e2fsprogs/old_e2fsprogs/ext2fs/kernel-list.h4
-rw-r--r--e2fsprogs/old_e2fsprogs/uuid/uuid.h5
-rw-r--r--include/busybox.h14
-rw-r--r--include/dump.h8
-rw-r--r--include/grp_.h17
-rw-r--r--include/libbb.h15
-rw-r--r--include/platform.h16
-rw-r--r--include/pwd_.h12
-rw-r--r--include/rtc_.h10
-rw-r--r--include/shadow_.h8
-rw-r--r--include/unarchive.h12
-rw-r--r--include/usage.h8
-rw-r--r--include/xatonum.h8
-rw-r--r--include/xregex.h12
-rw-r--r--modutils/modutils.h12
-rw-r--r--networking/isrv.h8
-rw-r--r--networking/libiproute/ip_common.h14
-rw-r--r--networking/libiproute/libnetlink.h15
-rw-r--r--networking/libiproute/ll_map.h14
-rw-r--r--networking/libiproute/rt_names.h14
-rw-r--r--networking/libiproute/rtm_map.h14
-rw-r--r--networking/libiproute/utils.h14
-rw-r--r--networking/tcpudp_perhost.h8
-rw-r--r--networking/udhcp/common.h13
-rw-r--r--networking/udhcp/dhcpc.h13
-rw-r--r--networking/udhcp/dhcpd.h13
-rw-r--r--networking/udhcp/options.h12
-rw-r--r--runit/runit_lib.h8
-rw-r--r--shell/match.h4
-rw-r--r--shell/math.h8
-rw-r--r--util-linux/volume_id/volume_id_internal.h9
43 files changed, 158 insertions, 266 deletions
diff --git a/coreutils/libcoreutils/coreutils.h b/coreutils/libcoreutils/coreutils.h
index 89cd9532f..99b67b14d 100644
--- a/coreutils/libcoreutils/coreutils.h
+++ b/coreutils/libcoreutils/coreutils.h
@@ -4,11 +4,9 @@
4 */ 4 */
5 5
6#ifndef COREUTILS_H 6#ifndef COREUTILS_H
7#define COREUTILS_H 1 7#define COREUTILS_H 1
8 8
9#if __GNUC_PREREQ(4,1) 9PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
10# pragma GCC visibility push(hidden)
11#endif
12 10
13typedef int (*stat_func)(const char *fn, struct stat *ps); 11typedef int (*stat_func)(const char *fn, struct stat *ps);
14 12
@@ -17,8 +15,6 @@ int cp_mv_stat(const char *fn, struct stat *fn_stat) FAST_FUNC;
17 15
18mode_t getopt_mk_fifo_nod(char **argv) FAST_FUNC; 16mode_t getopt_mk_fifo_nod(char **argv) FAST_FUNC;
19 17
20#if __GNUC_PREREQ(4,1) 18POP_SAVED_FUNCTION_VISIBILITY
21# pragma GCC visibility pop
22#endif
23 19
24#endif 20#endif
diff --git a/e2fsprogs/e2fs_defs.h b/e2fsprogs/e2fs_defs.h
index b3ea3ae34..379640eb8 100644
--- a/e2fsprogs/e2fs_defs.h
+++ b/e2fsprogs/e2fs_defs.h
@@ -10,8 +10,8 @@
10 * Copyright (C) 1991, 1992 Linus Torvalds 10 * Copyright (C) 1991, 1992 Linus Torvalds
11 */ 11 */
12 12
13#ifndef _LINUX_EXT2_FS_H 13#ifndef LINUX_EXT2_FS_H
14#define _LINUX_EXT2_FS_H 14#define LINUX_EXT2_FS_H 1
15 15
16/* 16/*
17 * Special inode numbers 17 * Special inode numbers
@@ -558,4 +558,4 @@ struct ext2_dir_entry_2 {
558#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \ 558#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \
559 ~EXT2_DIR_ROUND) 559 ~EXT2_DIR_ROUND)
560 560
561#endif /* _LINUX_EXT2_FS_H */ 561#endif
diff --git a/e2fsprogs/e2fs_lib.h b/e2fsprogs/e2fs_lib.h
index e21a0f917..25b26d382 100644
--- a/e2fsprogs/e2fs_lib.h
+++ b/e2fsprogs/e2fs_lib.h
@@ -9,9 +9,7 @@
9/* Constants and structures */ 9/* Constants and structures */
10#include "e2fs_defs.h" 10#include "e2fs_defs.h"
11 11
12#if __GNUC_PREREQ(4,1) 12PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
13# pragma GCC visibility push(hidden)
14#endif
15 13
16/* Iterate a function on each entry of a directory */ 14/* Iterate a function on each entry of a directory */
17int iterate_on_dir(const char *dir_name, 15int iterate_on_dir(const char *dir_name,
@@ -46,6 +44,4 @@ extern const char e2attr_flags_sname[];
46#define e2attr_flags_sname_chattr (&e2attr_flags_sname[1]) 44#define e2attr_flags_sname_chattr (&e2attr_flags_sname[1])
47#endif 45#endif
48 46
49#if __GNUC_PREREQ(4,1) 47POP_SAVED_FUNCTION_VISIBILITY
50# pragma GCC visibility pop
51#endif
diff --git a/e2fsprogs/old_e2fsprogs/blkid/blkid.h b/e2fsprogs/old_e2fsprogs/blkid/blkid.h
index 4fa9f6fdf..9a3c2afdb 100644
--- a/e2fsprogs/old_e2fsprogs/blkid/blkid.h
+++ b/e2fsprogs/old_e2fsprogs/blkid/blkid.h
@@ -10,9 +10,8 @@
10 * GNU Lesser General Public License. 10 * GNU Lesser General Public License.
11 * %End-Header% 11 * %End-Header%
12 */ 12 */
13 13#ifndef BLKID_BLKID_H
14#ifndef _BLKID_BLKID_H 14#define BLKID_BLKID_H 1
15#define _BLKID_BLKID_H
16 15
17#include <sys/types.h> 16#include <sys/types.h>
18#include <linux/types.h> 17#include <linux/types.h>
@@ -102,4 +101,4 @@ extern int blkid_parse_tag_string(const char *token, char **ret_type,
102} 101}
103#endif 102#endif
104 103
105#endif /* _BLKID_BLKID_H */ 104#endif
diff --git a/e2fsprogs/old_e2fsprogs/blkid/blkidP.h b/e2fsprogs/old_e2fsprogs/blkid/blkidP.h
index c7cb8abe9..d6b2b42cc 100644
--- a/e2fsprogs/old_e2fsprogs/blkid/blkidP.h
+++ b/e2fsprogs/old_e2fsprogs/blkid/blkidP.h
@@ -10,9 +10,8 @@
10 * GNU Lesser General Public License. 10 * GNU Lesser General Public License.
11 * %End-Header% 11 * %End-Header%
12 */ 12 */
13 13#ifndef BLKID_BLKIDP_H
14#ifndef _BLKID_BLKIDP_H 14#define BLKID_BLKIDP_H 1
15#define _BLKID_BLKIDP_H
16 15
17#include <sys/types.h> 16#include <sys/types.h>
18#include <stdio.h> 17#include <stdio.h>
@@ -184,4 +183,4 @@ extern void blkid_free_dev(blkid_dev dev);
184} 183}
185#endif 184#endif
186 185
187#endif /* _BLKID_BLKIDP_H */ 186#endif
diff --git a/e2fsprogs/old_e2fsprogs/blkid/list.h b/e2fsprogs/old_e2fsprogs/blkid/list.h
index 8b06d853b..a24baaa91 100644
--- a/e2fsprogs/old_e2fsprogs/blkid/list.h
+++ b/e2fsprogs/old_e2fsprogs/blkid/list.h
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2#if !defined(_BLKID_LIST_H) && !defined(LIST_HEAD) 2#if !defined(_BLKID_LIST_H) && !defined(LIST_HEAD)
3#define _BLKID_LIST_H 3#define BLKID_LIST_H 1
4 4
5#ifdef __cplusplus 5#ifdef __cplusplus
6extern "C" { 6extern "C" {
@@ -70,4 +70,4 @@ void list_splice(struct list_head *list, struct list_head *head);
70} 70}
71#endif 71#endif
72 72
73#endif /* _BLKID_LIST_H */ 73#endif
diff --git a/e2fsprogs/old_e2fsprogs/blkid/probe.h b/e2fsprogs/old_e2fsprogs/blkid/probe.h
index ef289f505..b6d8f8e7d 100644
--- a/e2fsprogs/old_e2fsprogs/blkid/probe.h
+++ b/e2fsprogs/old_e2fsprogs/blkid/probe.h
@@ -11,9 +11,8 @@
11 * GNU Lesser General Public License. 11 * GNU Lesser General Public License.
12 * %End-Header% 12 * %End-Header%
13 */ 13 */
14 14#ifndef BLKID_PROBE_H
15#ifndef _BLKID_PROBE_H 15#define BLKID_PROBE_H 1
16#define _BLKID_PROBE_H
17 16
18#include <linux/types.h> 17#include <linux/types.h>
19 18
diff --git a/e2fsprogs/old_e2fsprogs/e2fsbb.h b/e2fsprogs/old_e2fsprogs/e2fsbb.h
index 78e7cbd04..d31c31955 100644
--- a/e2fsprogs/old_e2fsprogs/e2fsbb.h
+++ b/e2fsprogs/old_e2fsprogs/e2fsbb.h
@@ -6,8 +6,8 @@
6 * instead. This makes upgrade between e2fsprogs versions easy. 6 * instead. This makes upgrade between e2fsprogs versions easy.
7 */ 7 */
8 8
9#ifndef __E2FSBB_H__ 9#ifndef E2FSBB_H
10#define __E2FSBB_H__ 1 10#define E2FSBB_H 1
11 11
12#include "libbb.h" 12#include "libbb.h"
13 13
@@ -40,4 +40,4 @@ typedef long errcode_t;
40#define WORDS_BIGENDIAN 1 40#define WORDS_BIGENDIAN 1
41#endif 41#endif
42 42
43#endif /* __E2FSBB_H__ */ 43#endif
diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/ext2_fs.h b/e2fsprogs/old_e2fsprogs/ext2fs/ext2_fs.h
index cb49d7a60..6f4f70862 100644
--- a/e2fsprogs/old_e2fsprogs/ext2fs/ext2_fs.h
+++ b/e2fsprogs/old_e2fsprogs/ext2fs/ext2_fs.h
@@ -13,9 +13,8 @@
13 * 13 *
14 * Copyright (C) 1991, 1992 Linus Torvalds 14 * Copyright (C) 1991, 1992 Linus Torvalds
15 */ 15 */
16 16#ifndef LINUX_EXT2_FS_H
17#ifndef _LINUX_EXT2_FS_H 17#define LINUX_EXT2_FS_H 1
18#define _LINUX_EXT2_FS_H
19 18
20#include "ext2_types.h" /* Changed from linux/types.h */ 19#include "ext2_types.h" /* Changed from linux/types.h */
21 20
@@ -567,4 +566,4 @@ struct ext2_dir_entry_2 {
567#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \ 566#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \
568 ~EXT2_DIR_ROUND) 567 ~EXT2_DIR_ROUND)
569 568
570#endif /* _LINUX_EXT2_FS_H */ 569#endif
diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/ext2_io.h b/e2fsprogs/old_e2fsprogs/ext2fs/ext2_io.h
index e6c9630e2..1900a7639 100644
--- a/e2fsprogs/old_e2fsprogs/ext2fs/ext2_io.h
+++ b/e2fsprogs/old_e2fsprogs/ext2fs/ext2_io.h
@@ -9,9 +9,8 @@
9 * License. 9 * License.
10 * %End-Header% 10 * %End-Header%
11 */ 11 */
12 12#ifndef EXT2FS_EXT2_IO_H
13#ifndef _EXT2FS_EXT2_IO_H 13#define EXT2FS_EXT2_IO_H 1
14#define _EXT2FS_EXT2_IO_H
15 14
16/* 15/*
17 * ext2_loff_t is defined here since unix_io.c needs it. 16 * ext2_loff_t is defined here since unix_io.c needs it.
@@ -110,5 +109,4 @@ extern void (*test_io_cb_write_blk)
110extern void (*test_io_cb_set_blksize) 109extern void (*test_io_cb_set_blksize)
111 (int blksize, errcode_t err); 110 (int blksize, errcode_t err);
112 111
113#endif /* _EXT2FS_EXT2_IO_H */ 112#endif
114
diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/ext2fs.h b/e2fsprogs/old_e2fsprogs/ext2fs/ext2fs.h
index 133fb1f1b..9f772016f 100644
--- a/e2fsprogs/old_e2fsprogs/ext2fs/ext2fs.h
+++ b/e2fsprogs/old_e2fsprogs/ext2fs/ext2fs.h
@@ -9,9 +9,8 @@
9 * License. 9 * License.
10 * %End-Header% 10 * %End-Header%
11 */ 11 */
12 12#ifndef EXT2FS_EXT2FS_H
13#ifndef _EXT2FS_EXT2FS_H 13#define EXT2FS_EXT2FS_H 1
14#define _EXT2FS_EXT2FS_H
15 14
16 15
17#define EXT2FS_ATTR(x) 16#define EXT2FS_ATTR(x)
@@ -920,4 +919,4 @@ extern blk_t ext2fs_inode_data_blocks(ext2_filsys fs,
920} 919}
921#endif 920#endif
922 921
923#endif /* _EXT2FS_EXT2FS_H */ 922#endif
diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/kernel-jbd.h b/e2fsprogs/old_e2fsprogs/ext2fs/kernel-jbd.h
index 4c6c7dedd..853d97ac7 100644
--- a/e2fsprogs/old_e2fsprogs/ext2fs/kernel-jbd.h
+++ b/e2fsprogs/old_e2fsprogs/ext2fs/kernel-jbd.h
@@ -13,9 +13,8 @@
13 * Definitions for transaction data structures for the buffer cache 13 * Definitions for transaction data structures for the buffer cache
14 * filesystem journaling support. 14 * filesystem journaling support.
15 */ 15 */
16 16#ifndef LINUX_JBD_H
17#ifndef _LINUX_JBD_H 17#define LINUX_JBD_H 1
18#define _LINUX_JBD_H
19 18
20#include <sys/types.h> 19#include <sys/types.h>
21#include <linux/types.h> 20#include <linux/types.h>
@@ -233,4 +232,4 @@ extern void journal_brelse_array(struct buffer_head *b[], int n);
233extern void journal_destroy_revoke(journal_t *); 232extern void journal_destroy_revoke(journal_t *);
234 233
235 234
236#endif /* _LINUX_JBD_H */ 235#endif
diff --git a/e2fsprogs/old_e2fsprogs/ext2fs/kernel-list.h b/e2fsprogs/old_e2fsprogs/ext2fs/kernel-list.h
index 3392596ca..d80716a45 100644
--- a/e2fsprogs/old_e2fsprogs/ext2fs/kernel-list.h
+++ b/e2fsprogs/old_e2fsprogs/ext2fs/kernel-list.h
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2#ifndef _LINUX_LIST_H 2#ifndef LINUX_LIST_H
3#define _LINUX_LIST_H 3#define LINUX_LIST_H 1
4 4
5/* 5/*
6 * Simple doubly linked list implementation. 6 * Simple doubly linked list implementation.
diff --git a/e2fsprogs/old_e2fsprogs/uuid/uuid.h b/e2fsprogs/old_e2fsprogs/uuid/uuid.h
index b30ca3c62..7a9706449 100644
--- a/e2fsprogs/old_e2fsprogs/uuid/uuid.h
+++ b/e2fsprogs/old_e2fsprogs/uuid/uuid.h
@@ -32,9 +32,8 @@
32 * DAMAGE. 32 * DAMAGE.
33 * %End-Header% 33 * %End-Header%
34 */ 34 */
35 35#ifndef UUID_UUID_H
36#ifndef _UUID_UUID_H 36#define UUID_UUID_H 1
37#define _UUID_UUID_H
38 37
39#include <sys/types.h> 38#include <sys/types.h>
40#include <time.h> 39#include <time.h>
diff --git a/include/busybox.h b/include/busybox.h
index 314b95126..54c278f87 100644
--- a/include/busybox.h
+++ b/include/busybox.h
@@ -4,14 +4,12 @@
4 * 4 *
5 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. 5 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
6 */ 6 */
7#ifndef _BB_INTERNAL_H_ 7#ifndef BUSYBOX_H
8#define _BB_INTERNAL_H_ 1 8#define BUSYBOX_H 1
9 9
10#include "libbb.h" 10#include "libbb.h"
11 11
12#if __GNUC_PREREQ(4,1) 12PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
13# pragma GCC visibility push(hidden)
14#endif
15 13
16/* order matters: used as index into "install_dir[]" in appletlib.c */ 14/* order matters: used as index into "install_dir[]" in appletlib.c */
17typedef enum bb_install_loc_t { 15typedef enum bb_install_loc_t {
@@ -71,8 +69,6 @@ int lbb_main(char **argv);
71#endif 69#endif
72#endif 70#endif
73 71
74#if __GNUC_PREREQ(4,1) 72POP_SAVED_FUNCTION_VISIBILITY
75# pragma GCC visibility pop
76#endif
77 73
78#endif /* _BB_INTERNAL_H_ */ 74#endif
diff --git a/include/dump.h b/include/dump.h
index 44f2082b7..925270d9c 100644
--- a/include/dump.h
+++ b/include/dump.h
@@ -1,8 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2 2
3#if __GNUC_PREREQ(4,1) 3PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
4# pragma GCC visibility push(hidden)
5#endif
6 4
7#define F_IGNORE 0x01 /* %_A */ 5#define F_IGNORE 0x01 /* %_A */
8#define F_SETREP 0x02 /* rep count set, not default */ 6#define F_SETREP 0x02 /* rep count set, not default */
@@ -55,6 +53,4 @@ dumper_t* alloc_dumper(void) FAST_FUNC;
55extern void bb_dump_add(dumper_t *dumper, const char *fmt) FAST_FUNC; 53extern void bb_dump_add(dumper_t *dumper, const char *fmt) FAST_FUNC;
56extern int bb_dump_dump(dumper_t *dumper, char **argv) FAST_FUNC; 54extern int bb_dump_dump(dumper_t *dumper, char **argv) FAST_FUNC;
57 55
58#if __GNUC_PREREQ(4,1) 56POP_SAVED_FUNCTION_VISIBILITY
59# pragma GCC visibility pop
60#endif
diff --git a/include/grp_.h b/include/grp_.h
index 3d00b4aa7..deaf9e6a3 100644
--- a/include/grp_.h
+++ b/include/grp_.h
@@ -15,18 +15,15 @@
15 You should have received a copy of the GNU Lesser General Public 15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free 16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 02111-1307 USA. */ 18 02111-1307 USA.
19 19 */
20/* 20/*
21 * POSIX Standard: 9.2.1 Group Database Access <grp.h> 21 * POSIX Standard: 9.2.1 Group Database Access <grp.h>
22 */ 22 */
23#ifndef BB_GRP_H
24#define BB_GRP_H 1
23 25
24#ifndef BB_GRP_H 26PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
25#define BB_GRP_H 1
26
27#if __GNUC_PREREQ(4,1)
28# pragma GCC visibility push(hidden)
29#endif
30 27
31/* This file is #included after #include <grp.h> 28/* This file is #included after #include <grp.h>
32 * We will use libc-defined structures, but will #define function names 29 * We will use libc-defined structures, but will #define function names
@@ -115,8 +112,6 @@ extern int getgrouplist(const char *__user, gid_t __group,
115 of which USER is a member. Also include GROUP. */ 112 of which USER is a member. Also include GROUP. */
116extern int initgroups(const char *__user, gid_t __group); 113extern int initgroups(const char *__user, gid_t __group);
117 114
118#if __GNUC_PREREQ(4,1) 115POP_SAVED_FUNCTION_VISIBILITY
119# pragma GCC visibility pop
120#endif
121 116
122#endif 117#endif
diff --git a/include/libbb.h b/include/libbb.h
index 74ec678d8..babf9c9f7 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -7,8 +7,8 @@
7 * 7 *
8 * Licensed under the GPL version 2, see the file LICENSE in this tarball. 8 * Licensed under the GPL version 2, see the file LICENSE in this tarball.
9 */ 9 */
10#ifndef __LIBBUSYBOX_H__ 10#ifndef LIBBB_H
11#define __LIBBUSYBOX_H__ 1 11#define LIBBB_H 1
12 12
13#include "platform.h" 13#include "platform.h"
14 14
@@ -110,9 +110,7 @@ int sysinfo(struct sysinfo* info);
110 110
111/* Make all declarations hidden (-fvisibility flag only affects definitions) */ 111/* Make all declarations hidden (-fvisibility flag only affects definitions) */
112/* (don't include system headers after this until corresponding pop!) */ 112/* (don't include system headers after this until corresponding pop!) */
113#if __GNUC_PREREQ(4,1) 113PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
114# pragma GCC visibility push(hidden)
115#endif
116 114
117 115
118#if ENABLE_USE_BB_PWD_GRP 116#if ENABLE_USE_BB_PWD_GRP
@@ -1532,9 +1530,6 @@ extern const char bb_default_login_shell[];
1532#define ARRAY_SIZE(x) ((unsigned)(sizeof(x) / sizeof((x)[0]))) 1530#define ARRAY_SIZE(x) ((unsigned)(sizeof(x) / sizeof((x)[0])))
1533 1531
1534 1532
1535#if __GNUC_PREREQ(4,1) 1533POP_SAVED_FUNCTION_VISIBILITY
1536# pragma GCC visibility pop
1537#endif
1538
1539 1534
1540#endif /* __LIBBUSYBOX_H__ */ 1535#endif
diff --git a/include/platform.h b/include/platform.h
index 13dfcbd32..47fd5f63d 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -4,8 +4,8 @@
4 4
5 Licensed under the GPL v2 or later, see the file LICENSE in this tarball. 5 Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
6*/ 6*/
7#ifndef __PLATFORM_H 7#ifndef BB_PLATFORM_H
8#define __PLATFORM_H 1 8#define BB_PLATFORM_H 1
9 9
10/* Convenience macros to test the version of gcc. */ 10/* Convenience macros to test the version of gcc. */
11#undef __GNUC_PREREQ 11#undef __GNUC_PREREQ
@@ -110,6 +110,16 @@
110# define FAST_FUNC 110# define FAST_FUNC
111#endif 111#endif
112 112
113/* Make all declarations hidden (-fvisibility flag only affects definitions) */
114/* (don't include system headers after this until corresponding pop!) */
115#if __GNUC_PREREQ(4,1)
116# define PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN _Pragma("GCC visibility push(hidden)")
117# define POP_SAVED_FUNCTION_VISIBILITY _Pragma("GCC visibility pop")
118#else
119# define PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
120# define POP_SAVED_FUNCTION_VISIBILITY
121#endif
122
113/* ---- Endian Detection ------------------------------------ */ 123/* ---- Endian Detection ------------------------------------ */
114 124
115#if (defined __digital__ && defined __unix__) 125#if (defined __digital__ && defined __unix__)
@@ -371,4 +381,4 @@ static ALWAYS_INLINE char* strchrnul(const char *s, char c)
371#endif 381#endif
372#endif 382#endif
373 383
374#endif /* platform.h */ 384#endif
diff --git a/include/pwd_.h b/include/pwd_.h
index a0cf7c9f7..f52445ceb 100644
--- a/include/pwd_.h
+++ b/include/pwd_.h
@@ -21,12 +21,10 @@
21 * POSIX Standard: 9.2.2 User Database Access <pwd.h> 21 * POSIX Standard: 9.2.2 User Database Access <pwd.h>
22 */ 22 */
23 23
24#ifndef BB_PWD_H 24#ifndef BB_PWD_H
25#define BB_PWD_H 1 25#define BB_PWD_H 1
26 26
27#if __GNUC_PREREQ(4,1) 27PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
28# pragma GCC visibility push(hidden)
29#endif
30 28
31/* This file is #included after #include <pwd.h> 29/* This file is #included after #include <pwd.h>
32 * We will use libc-defined structures, but will #define function names 30 * We will use libc-defined structures, but will #define function names
@@ -107,8 +105,6 @@ extern int fgetpwent_r(FILE *__restrict __stream,
107 will expect, but this need not be the format of the password file. */ 105 will expect, but this need not be the format of the password file. */
108/* UNUSED extern int getpw(uid_t __uid, char *__buffer); */ 106/* UNUSED extern int getpw(uid_t __uid, char *__buffer); */
109 107
110#if __GNUC_PREREQ(4,1) 108POP_SAVED_FUNCTION_VISIBILITY
111# pragma GCC visibility pop
112#endif
113 109
114#endif /* pwd.h */ 110#endif /* pwd.h */
diff --git a/include/rtc_.h b/include/rtc_.h
index ae17ee7d4..74bb695a0 100644
--- a/include/rtc_.h
+++ b/include/rtc_.h
@@ -5,13 +5,11 @@
5 */ 5 */
6 6
7#ifndef BB_RTC_H 7#ifndef BB_RTC_H
8#define BB_RTC_H 8#define BB_RTC_H 1
9 9
10#include "libbb.h" 10#include "libbb.h"
11 11
12#if __GNUC_PREREQ(4,1) 12PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
13# pragma GCC visibility push(hidden)
14#endif
15 13
16extern int rtc_adjtime_is_utc(void) FAST_FUNC; 14extern int rtc_adjtime_is_utc(void) FAST_FUNC;
17extern int rtc_xopen(const char **default_rtc, int flags) FAST_FUNC; 15extern int rtc_xopen(const char **default_rtc, int flags) FAST_FUNC;
@@ -71,8 +69,6 @@ struct linux_rtc_wkalrm {
71#define RTC_AF 0x20 69#define RTC_AF 0x20
72#define RTC_UF 0x10 70#define RTC_UF 0x10
73 71
74#if __GNUC_PREREQ(4,1) 72POP_SAVED_FUNCTION_VISIBILITY
75# pragma GCC visibility pop
76#endif
77 73
78#endif 74#endif
diff --git a/include/shadow_.h b/include/shadow_.h
index 60f3e6b5f..02d3bf9a5 100644
--- a/include/shadow_.h
+++ b/include/shadow_.h
@@ -22,9 +22,7 @@
22#ifndef BB_SHADOW_H 22#ifndef BB_SHADOW_H
23#define BB_SHADOW_H 1 23#define BB_SHADOW_H 1
24 24
25#if __GNUC_PREREQ(4,1) 25PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
26# pragma GCC visibility push(hidden)
27#endif
28 26
29/* This file is #included after #include <shadow.h> 27/* This file is #included after #include <shadow.h>
30 * We will use libc-defined structures, but will #define function names 28 * We will use libc-defined structures, but will #define function names
@@ -97,8 +95,6 @@ extern int lckpwdf(void);
97/* Unlock password file */ 95/* Unlock password file */
98extern int ulckpwdf(void); 96extern int ulckpwdf(void);
99 97
100#if __GNUC_PREREQ(4,1) 98POP_SAVED_FUNCTION_VISIBILITY
101# pragma GCC visibility pop
102#endif
103 99
104#endif /* shadow.h */ 100#endif /* shadow.h */
diff --git a/include/unarchive.h b/include/unarchive.h
index 9077130a5..beb962c8f 100644
--- a/include/unarchive.h
+++ b/include/unarchive.h
@@ -1,10 +1,8 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2#ifndef __UNARCHIVE_H__ 2#ifndef UNARCHIVE_H
3#define __UNARCHIVE_H__ 3#define UNARCHIVE_H 1
4 4
5#if __GNUC_PREREQ(4,1) 5PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
6# pragma GCC visibility push(hidden)
7#endif
8 6
9#define ARCHIVE_PRESERVE_DATE 1 7#define ARCHIVE_PRESERVE_DATE 1
10#define ARCHIVE_CREATE_LEADING_DIRS 2 8#define ARCHIVE_CREATE_LEADING_DIRS 2
@@ -150,8 +148,6 @@ void open_transformer(int src_fd, const char *transform_prog) FAST_FUNC;
150#define open_transformer(fd, transformer, transform_prog) open_transformer(fd, transform_prog) 148#define open_transformer(fd, transformer, transform_prog) open_transformer(fd, transform_prog)
151#endif 149#endif
152 150
153#if __GNUC_PREREQ(4,1) 151POP_SAVED_FUNCTION_VISIBILITY
154# pragma GCC visibility pop
155#endif
156 152
157#endif 153#endif
diff --git a/include/usage.h b/include/usage.h
index af54b86a7..cbbd7516a 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -9,9 +9,8 @@
9 * or 9 * or
10 * |<5 spaces>"\ntext with tabs".... 10 * |<5 spaces>"\ntext with tabs"....
11 */ 11 */
12 12#ifndef BB_USAGE_H
13#ifndef __BB_USAGE_H__ 13#define BB_USAGE_H 1
14#define __BB_USAGE_H__
15 14
16 15
17#define NOUSAGE_STR "\b" 16#define NOUSAGE_STR "\b"
@@ -4921,4 +4920,5 @@ USE_FEATURE_TUNCTL_UG( \
4921 "\nWith no -q, runs continuously monitoring for ARP conflicts," \ 4920 "\nWith no -q, runs continuously monitoring for ARP conflicts," \
4922 "\nexits only on I/O errors (link down etc)" \ 4921 "\nexits only on I/O errors (link down etc)" \
4923 4922
4924#endif /* __BB_USAGE_H__ */ 4923
4924#endif
diff --git a/include/xatonum.h b/include/xatonum.h
index 86a3472d9..ee816efb4 100644
--- a/include/xatonum.h
+++ b/include/xatonum.h
@@ -7,9 +7,7 @@
7 * Licensed under GPLv2, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2, see file LICENSE in this tarball for details.
8 */ 8 */
9 9
10#if __GNUC_PREREQ(4,1) 10PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
11# pragma GCC visibility push(hidden)
12#endif
13 11
14/* Provides extern declarations of functions */ 12/* Provides extern declarations of functions */
15#define DECLARE_STR_CONV(type, T, UT) \ 13#define DECLARE_STR_CONV(type, T, UT) \
@@ -171,6 +169,4 @@ uint32_t bb_strtou32(const char *arg, char **endp, int base)
171 169
172double bb_strtod(const char *arg, char **endp) FAST_FUNC; 170double bb_strtod(const char *arg, char **endp) FAST_FUNC;
173 171
174#if __GNUC_PREREQ(4,1) 172POP_SAVED_FUNCTION_VISIBILITY
175# pragma GCC visibility pop
176#endif
diff --git a/include/xregex.h b/include/xregex.h
index 90cf124ee..61658ed85 100644
--- a/include/xregex.h
+++ b/include/xregex.h
@@ -8,20 +8,16 @@
8 * 8 *
9 * Licensed under GPLv2 or later, see file License in this tarball for details. 9 * Licensed under GPLv2 or later, see file License in this tarball for details.
10 */ 10 */
11#ifndef __BB_REGEX__ 11#ifndef BB_REGEX_H
12#define __BB_REGEX__ 12#define BB_REGEX_H 1
13 13
14#include <regex.h> 14#include <regex.h>
15 15
16#if __GNUC_PREREQ(4,1) 16PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
17# pragma GCC visibility push(hidden)
18#endif
19 17
20char* regcomp_or_errmsg(regex_t *preg, const char *regex, int cflags) FAST_FUNC; 18char* regcomp_or_errmsg(regex_t *preg, const char *regex, int cflags) FAST_FUNC;
21void xregcomp(regex_t *preg, const char *regex, int cflags) FAST_FUNC; 19void xregcomp(regex_t *preg, const char *regex, int cflags) FAST_FUNC;
22 20
23#if __GNUC_PREREQ(4,1) 21POP_SAVED_FUNCTION_VISIBILITY
24# pragma GCC visibility pop
25#endif
26 22
27#endif 23#endif
diff --git a/modutils/modutils.h b/modutils/modutils.h
index 0a29ff240..086bb3977 100644
--- a/modutils/modutils.h
+++ b/modutils/modutils.h
@@ -6,14 +6,12 @@
6 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 6 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
7 */ 7 */
8 8
9#ifndef __MODUTILS_H__ 9#ifndef MODUTILS_H
10#define __MODUTILS_H__ 10#define MODUTILS_H 1
11 11
12#include "libbb.h" 12#include "libbb.h"
13 13
14#if __GNUC_PREREQ(4,1) 14PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
15# pragma GCC visibility push(hidden)
16#endif
17 15
18/* linux/include/linux/module.h has 64, but this is also used 16/* linux/include/linux/module.h has 64, but this is also used
19 * internally for the maximum alias name length, which can be quite long */ 17 * internally for the maximum alias name length, which can be quite long */
@@ -62,8 +60,6 @@ int FAST_FUNC bb_delete_module(const char *module, unsigned int flags);
62int FAST_FUNC bb_init_module_24(const char *module, const char *options); 60int FAST_FUNC bb_init_module_24(const char *module, const char *options);
63#endif 61#endif
64 62
65#if __GNUC_PREREQ(4,1) 63POP_SAVED_FUNCTION_VISIBILITY
66# pragma GCC visibility pop
67#endif
68 64
69#endif 65#endif
diff --git a/networking/isrv.h b/networking/isrv.h
index c0158a3e3..f20714df8 100644
--- a/networking/isrv.h
+++ b/networking/isrv.h
@@ -8,9 +8,7 @@
8 * Licensed under GPL version 2, see file LICENSE in this tarball for details. 8 * Licensed under GPL version 2, see file LICENSE in this tarball for details.
9 */ 9 */
10 10
11#if __GNUC_PREREQ(4,1) 11PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
12# pragma GCC visibility push(hidden)
13#endif
14 12
15/* opaque structure */ 13/* opaque structure */
16struct isrv_state_t; 14struct isrv_state_t;
@@ -36,6 +34,4 @@ void isrv_run(
36 int linger_timeout 34 int linger_timeout
37); 35);
38 36
39#if __GNUC_PREREQ(4,1) 37POP_SAVED_FUNCTION_VISIBILITY
40# pragma GCC visibility pop
41#endif
diff --git a/networking/libiproute/ip_common.h b/networking/libiproute/ip_common.h
index 305b491c6..aef325281 100644
--- a/networking/libiproute/ip_common.h
+++ b/networking/libiproute/ip_common.h
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2#ifndef _IP_COMMON_H 2#ifndef IP_COMMON_H
3#define _IP_COMMON_H 1 3#define IP_COMMON_H 1
4 4
5#include "libbb.h" 5#include "libbb.h"
6#include <asm/types.h> 6#include <asm/types.h>
@@ -13,9 +13,7 @@
13#include <linux/if_link.h> 13#include <linux/if_link.h>
14#endif 14#endif
15 15
16#if __GNUC_PREREQ(4,1) 16PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
17# pragma GCC visibility push(hidden)
18#endif
19 17
20extern char **ip_parse_common_args(char **argv); 18extern char **ip_parse_common_args(char **argv);
21extern int print_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg); 19extern int print_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
@@ -34,8 +32,6 @@ extern int do_ipmonitor(char **argv);
34extern int do_multiaddr(char **argv); 32extern int do_multiaddr(char **argv);
35extern int do_multiroute(char **argv); 33extern int do_multiroute(char **argv);
36 34
37#if __GNUC_PREREQ(4,1) 35POP_SAVED_FUNCTION_VISIBILITY
38# pragma GCC visibility pop
39#endif
40 36
41#endif /* ip_common.h */ 37#endif
diff --git a/networking/libiproute/libnetlink.h b/networking/libiproute/libnetlink.h
index 079153b92..e5fee4dd8 100644
--- a/networking/libiproute/libnetlink.h
+++ b/networking/libiproute/libnetlink.h
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2#ifndef __LIBNETLINK_H__ 2#ifndef LIBNETLINK_H
3#define __LIBNETLINK_H__ 1 3#define LIBNETLINK_H 1
4 4
5#include <linux/types.h> 5#include <linux/types.h>
6/* We need linux/types.h because older kernels use __u32 etc 6/* We need linux/types.h because older kernels use __u32 etc
@@ -8,10 +8,7 @@
8#include <linux/netlink.h> 8#include <linux/netlink.h>
9#include <linux/rtnetlink.h> 9#include <linux/rtnetlink.h>
10 10
11 11PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
12#if __GNUC_PREREQ(4,1)
13# pragma GCC visibility push(hidden)
14#endif
15 12
16struct rtnl_handle 13struct rtnl_handle
17{ 14{
@@ -48,8 +45,6 @@ extern int rta_addattr_l(struct rtattr *rta, int maxlen, int type, void *data, i
48 45
49extern int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len) FAST_FUNC; 46extern int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len) FAST_FUNC;
50 47
51#if __GNUC_PREREQ(4,1) 48POP_SAVED_FUNCTION_VISIBILITY
52# pragma GCC visibility pop
53#endif
54 49
55#endif /* __LIBNETLINK_H__ */ 50#endif
diff --git a/networking/libiproute/ll_map.h b/networking/libiproute/ll_map.h
index 6d64ac15a..3966def10 100644
--- a/networking/libiproute/ll_map.h
+++ b/networking/libiproute/ll_map.h
@@ -1,10 +1,8 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2#ifndef __LL_MAP_H__ 2#ifndef LL_MAP_H
3#define __LL_MAP_H__ 1 3#define LL_MAP_H 1
4 4
5#if __GNUC_PREREQ(4,1) 5PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
6# pragma GCC visibility push(hidden)
7#endif
8 6
9int ll_remember_index(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg); 7int ll_remember_index(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
10int ll_init_map(struct rtnl_handle *rth); 8int ll_init_map(struct rtnl_handle *rth);
@@ -14,8 +12,6 @@ const char *ll_idx_n2a(int idx, char *buf);
14/* int ll_index_to_type(int idx); */ 12/* int ll_index_to_type(int idx); */
15unsigned ll_index_to_flags(int idx); 13unsigned ll_index_to_flags(int idx);
16 14
17#if __GNUC_PREREQ(4,1) 15POP_SAVED_FUNCTION_VISIBILITY
18# pragma GCC visibility pop
19#endif
20 16
21#endif /* __LL_MAP_H__ */ 17#endif
diff --git a/networking/libiproute/rt_names.h b/networking/libiproute/rt_names.h
index 3d68b67c8..a2d4fd142 100644
--- a/networking/libiproute/rt_names.h
+++ b/networking/libiproute/rt_names.h
@@ -1,10 +1,8 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2#ifndef RT_NAMES_H_ 2#ifndef RT_NAMES_H
3#define RT_NAMES_H_ 1 3#define RT_NAMES_H 1
4 4
5#if __GNUC_PREREQ(4,1) 5PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
6# pragma GCC visibility push(hidden)
7#endif
8 6
9extern const char* rtnl_rtprot_n2a(int id, char *buf, int len); 7extern const char* rtnl_rtprot_n2a(int id, char *buf, int len);
10extern const char* rtnl_rtscope_n2a(int id, char *buf, int len); 8extern const char* rtnl_rtscope_n2a(int id, char *buf, int len);
@@ -17,19 +15,15 @@ extern int rtnl_rtrealm_a2n(uint32_t *id, char *arg);
17extern int rtnl_dsfield_a2n(uint32_t *id, char *arg); 15extern int rtnl_dsfield_a2n(uint32_t *id, char *arg);
18extern int rtnl_rttable_a2n(uint32_t *id, char *arg); 16extern int rtnl_rttable_a2n(uint32_t *id, char *arg);
19 17
20
21extern const char* ll_type_n2a(int type, char *buf, int len); 18extern const char* ll_type_n2a(int type, char *buf, int len);
22 19
23extern const char* ll_addr_n2a(unsigned char *addr, int alen, int type, 20extern const char* ll_addr_n2a(unsigned char *addr, int alen, int type,
24 char *buf, int blen); 21 char *buf, int blen);
25extern int ll_addr_a2n(unsigned char *lladdr, int len, char *arg); 22extern int ll_addr_a2n(unsigned char *lladdr, int len, char *arg);
26 23
27
28extern const char* ll_proto_n2a(unsigned short id, char *buf, int len); 24extern const char* ll_proto_n2a(unsigned short id, char *buf, int len);
29extern int ll_proto_a2n(unsigned short *id, char *buf); 25extern int ll_proto_a2n(unsigned short *id, char *buf);
30 26
31#if __GNUC_PREREQ(4,1) 27POP_SAVED_FUNCTION_VISIBILITY
32# pragma GCC visibility pop
33#endif
34 28
35#endif 29#endif
diff --git a/networking/libiproute/rtm_map.h b/networking/libiproute/rtm_map.h
index 02fa77e42..ab1b70e45 100644
--- a/networking/libiproute/rtm_map.h
+++ b/networking/libiproute/rtm_map.h
@@ -1,18 +1,14 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2#ifndef __RTM_MAP_H__ 2#ifndef RTM_MAP_H
3#define __RTM_MAP_H__ 1 3#define RTM_MAP_H 1
4 4
5#if __GNUC_PREREQ(4,1) 5PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
6# pragma GCC visibility push(hidden)
7#endif
8 6
9const char *rtnl_rtntype_n2a(int id, char *buf, int len); 7const char *rtnl_rtntype_n2a(int id, char *buf, int len);
10int rtnl_rtntype_a2n(int *id, char *arg); 8int rtnl_rtntype_a2n(int *id, char *arg);
11 9
12int get_rt_realms(uint32_t *realms, char *arg); 10int get_rt_realms(uint32_t *realms, char *arg);
13 11
14#if __GNUC_PREREQ(4,1) 12POP_SAVED_FUNCTION_VISIBILITY
15# pragma GCC visibility pop
16#endif
17 13
18#endif /* __RTM_MAP_H__ */ 14#endif
diff --git a/networking/libiproute/utils.h b/networking/libiproute/utils.h
index 3603c75a7..ed03e785a 100644
--- a/networking/libiproute/utils.h
+++ b/networking/libiproute/utils.h
@@ -1,14 +1,12 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2#ifndef __UTILS_H__ 2#ifndef UTILS_H
3#define __UTILS_H__ 1 3#define UTILS_H 1
4 4
5#include "libnetlink.h" 5#include "libnetlink.h"
6#include "ll_map.h" 6#include "ll_map.h"
7#include "rtm_map.h" 7#include "rtm_map.h"
8 8
9#if __GNUC_PREREQ(4,1) 9PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
10# pragma GCC visibility push(hidden)
11#endif
12 10
13extern family_t preferred_family; 11extern family_t preferred_family;
14extern smallint show_stats; /* UNUSED */ 12extern smallint show_stats; /* UNUSED */
@@ -87,8 +85,6 @@ int dnet_pton(int af, const char *src, void *addr);
87const char *ipx_ntop(int af, const void *addr, char *str, size_t len); 85const char *ipx_ntop(int af, const void *addr, char *str, size_t len);
88int ipx_pton(int af, const char *src, void *addr); 86int ipx_pton(int af, const char *src, void *addr);
89 87
90#if __GNUC_PREREQ(4,1) 88POP_SAVED_FUNCTION_VISIBILITY
91# pragma GCC visibility pop
92#endif
93 89
94#endif /* __UTILS_H__ */ 90#endif
diff --git a/networking/tcpudp_perhost.h b/networking/tcpudp_perhost.h
index 2e093c1c4..d370036a7 100644
--- a/networking/tcpudp_perhost.h
+++ b/networking/tcpudp_perhost.h
@@ -7,9 +7,7 @@
7 * Licensed under GPLv2, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2, see file LICENSE in this tarball for details.
8 */ 8 */
9 9
10#if __GNUC_PREREQ(4,1) 10PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
11# pragma GCC visibility push(hidden)
12#endif
13 11
14struct hcc { 12struct hcc {
15 char *ip; 13 char *ip;
@@ -32,6 +30,4 @@ void ipsvd_perhost_remove(int pid);
32//unsigned ipsvd_perhost_setpid(int pid); 30//unsigned ipsvd_perhost_setpid(int pid);
33//void ipsvd_perhost_free(void); 31//void ipsvd_perhost_free(void);
34 32
35#if __GNUC_PREREQ(4,1) 33POP_SAVED_FUNCTION_VISIBILITY
36# pragma GCC visibility pop
37#endif
diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h
index 15f0d9a54..5a258c064 100644
--- a/networking/udhcp/common.h
+++ b/networking/udhcp/common.h
@@ -6,17 +6,14 @@
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 */ 8 */
9 9#ifndef UDHCP_COMMON_H
10#ifndef _COMMON_H 10#define UDHCP_COMMON_H 1
11#define _COMMON_H
12 11
13#include "libbb.h" 12#include "libbb.h"
14#include <netinet/udp.h> 13#include <netinet/udp.h>
15#include <netinet/ip.h> 14#include <netinet/ip.h>
16 15
17#if __GNUC_PREREQ(4,1) 16PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
18# pragma GCC visibility push(hidden)
19#endif
20 17
21#define DEFAULT_SCRIPT CONFIG_UDHCPC_DEFAULT_SCRIPT 18#define DEFAULT_SCRIPT CONFIG_UDHCPC_DEFAULT_SCRIPT
22 19
@@ -103,8 +100,6 @@ int arpping(uint32_t test_ip, uint32_t from_ip, uint8_t *from_mac, const char *i
103# define DEBUG(str, args...) do {;} while (0) 100# define DEBUG(str, args...) do {;} while (0)
104#endif 101#endif
105 102
106#if __GNUC_PREREQ(4,1) 103POP_SAVED_FUNCTION_VISIBILITY
107# pragma GCC visibility pop
108#endif
109 104
110#endif 105#endif
diff --git a/networking/udhcp/dhcpc.h b/networking/udhcp/dhcpc.h
index a9348497f..7b7794266 100644
--- a/networking/udhcp/dhcpc.h
+++ b/networking/udhcp/dhcpc.h
@@ -1,12 +1,9 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* dhcpc.h */ 2/* dhcpc.h */
3#ifndef UDHCP_DHCPC_H
4#define UDHCP_DHCPC_H 1
3 5
4#ifndef _DHCPC_H 6PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
5#define _DHCPC_H
6
7#if __GNUC_PREREQ(4,1)
8# pragma GCC visibility push(hidden)
9#endif
10 7
11struct client_config_t { 8struct client_config_t {
12 uint8_t arp[6]; /* Our arp address */ 9 uint8_t arp[6]; /* Our arp address */
@@ -49,8 +46,6 @@ int send_release(uint32_t server, uint32_t ciaddr) FAST_FUNC;
49 46
50int udhcp_recv_raw_packet(struct dhcpMessage *payload, int fd) FAST_FUNC; 47int udhcp_recv_raw_packet(struct dhcpMessage *payload, int fd) FAST_FUNC;
51 48
52#if __GNUC_PREREQ(4,1) 49POP_SAVED_FUNCTION_VISIBILITY
53# pragma GCC visibility pop
54#endif
55 50
56#endif 51#endif
diff --git a/networking/udhcp/dhcpd.h b/networking/udhcp/dhcpd.h
index b4e180882..9667c61e8 100644
--- a/networking/udhcp/dhcpd.h
+++ b/networking/udhcp/dhcpd.h
@@ -1,12 +1,9 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* dhcpd.h */ 2/* dhcpd.h */
3#ifndef UDHCP_DHCPD_H
4#define UDHCP_DHCPD_H 1
3 5
4#ifndef _DHCPD_H 6PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
5#define _DHCPD_H
6
7#if __GNUC_PREREQ(4,1)
8# pragma GCC visibility push(hidden)
9#endif
10 7
11/************************************/ 8/************************************/
12/* Defaults _you_ may want to tweak */ 9/* Defaults _you_ may want to tweak */
@@ -134,8 +131,6 @@ void read_leases(const char *file) FAST_FUNC;
134struct option_set *find_option(struct option_set *opt_list, uint8_t code) FAST_FUNC; 131struct option_set *find_option(struct option_set *opt_list, uint8_t code) FAST_FUNC;
135 132
136 133
137#if __GNUC_PREREQ(4,1) 134POP_SAVED_FUNCTION_VISIBILITY
138# pragma GCC visibility pop
139#endif
140 135
141#endif 136#endif
diff --git a/networking/udhcp/options.h b/networking/udhcp/options.h
index 87440c30c..23370da6e 100644
--- a/networking/udhcp/options.h
+++ b/networking/udhcp/options.h
@@ -1,11 +1,9 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* options.h */ 2/* options.h */
3#ifndef _OPTIONS_H 3#ifndef UDHCP_OPTIONS_H
4#define _OPTIONS_H 4#define UDHCP_OPTIONS_H 1
5 5
6#if __GNUC_PREREQ(4,1) 6PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
7# pragma GCC visibility push(hidden)
8#endif
9 7
10#define TYPE_MASK 0x0F 8#define TYPE_MASK 0x0F
11 9
@@ -111,8 +109,6 @@ char *dname_dec(const uint8_t *cstr, int clen, const char *pre) FAST_FUNC;
111uint8_t *dname_enc(const uint8_t *cstr, int clen, const char *src, int *retlen) FAST_FUNC; 109uint8_t *dname_enc(const uint8_t *cstr, int clen, const char *src, int *retlen) FAST_FUNC;
112#endif 110#endif
113 111
114#if __GNUC_PREREQ(4,1) 112POP_SAVED_FUNCTION_VISIBILITY
115# pragma GCC visibility pop
116#endif
117 113
118#endif 114#endif
diff --git a/runit/runit_lib.h b/runit/runit_lib.h
index b0b6dc220..fd94db9d7 100644
--- a/runit/runit_lib.h
+++ b/runit/runit_lib.h
@@ -25,9 +25,7 @@ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*/ 26*/
27 27
28#if __GNUC_PREREQ(4,1) 28PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
29# pragma GCC visibility push(hidden)
30#endif
31 29
32extern unsigned byte_chr(char *s,unsigned n,int c); 30extern unsigned byte_chr(char *s,unsigned n,int c);
33 31
@@ -100,6 +98,4 @@ struct ERR_svstatus_must_be_20_bytes {
100 char ERR_svstatus_must_be_20_bytes[sizeof(svstatus_t) == 20 ? 1 : -1]; 98 char ERR_svstatus_must_be_20_bytes[sizeof(svstatus_t) == 20 ? 1 : -1];
101}; 99};
102 100
103#if __GNUC_PREREQ(4,1) 101POP_SAVED_FUNCTION_VISIBILITY
104# pragma GCC visibility pop
105#endif
diff --git a/shell/match.h b/shell/match.h
index 863f52539..3fc4de340 100644
--- a/shell/match.h
+++ b/shell/match.h
@@ -1,5 +1,7 @@
1/* match.h - interface to shell ##/%% matching code */ 1/* match.h - interface to shell ##/%% matching code */
2 2
3PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
4
3typedef char *(*scan_t)(char *string, char *match, bool zero); 5typedef char *(*scan_t)(char *string, char *match, bool zero);
4 6
5char *scanleft(char *string, char *match, bool zero); 7char *scanleft(char *string, char *match, bool zero);
@@ -20,3 +22,5 @@ static inline scan_t pick_scan(char op1, char op2, bool *zero)
20 return op1 == op2 ? scanleft : scanright; 22 return op1 == op2 ? scanleft : scanright;
21 } 23 }
22} 24}
25
26POP_SAVED_FUNCTION_VISIBILITY
diff --git a/shell/math.h b/shell/math.h
index 195fc20ba..51dbb56cb 100644
--- a/shell/math.h
+++ b/shell/math.h
@@ -72,8 +72,10 @@
72 * below for the exact things that are available. 72 * below for the exact things that are available.
73 */ 73 */
74 74
75#ifndef _SHELL_MATH_ 75#ifndef SHELL_MATH_H
76#define _SHELL_MATH_ 76#define SHELL_MATH_H 1
77
78PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
77 79
78#if ENABLE_SH_MATH_SUPPORT_64 80#if ENABLE_SH_MATH_SUPPORT_64
79typedef long long arith_t; 81typedef long long arith_t;
@@ -96,4 +98,6 @@ typedef struct arith_eval_hooks {
96 98
97arith_t arith(const char *expr, int *perrcode, arith_eval_hooks_t*); 99arith_t arith(const char *expr, int *perrcode, arith_eval_hooks_t*);
98 100
101POP_SAVED_FUNCTION_VISIBILITY
102
99#endif 103#endif
diff --git a/util-linux/volume_id/volume_id_internal.h b/util-linux/volume_id/volume_id_internal.h
index d5258c54f..af58883bf 100644
--- a/util-linux/volume_id/volume_id_internal.h
+++ b/util-linux/volume_id/volume_id_internal.h
@@ -21,14 +21,11 @@
21#include "libbb.h" 21#include "libbb.h"
22#include "volume_id.h" 22#include "volume_id.h"
23 23
24#if __GNUC_PREREQ(4,1) 24PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
25# pragma GCC visibility push(hidden)
26#endif
27 25
28#define dbg(...) ((void)0) 26#define dbg(...) ((void)0)
29/* #define dbg(...) bb_error_msg(__VA_ARGS__) */ 27/* #define dbg(...) bb_error_msg(__VA_ARGS__) */
30 28
31
32/* volume_id.h */ 29/* volume_id.h */
33 30
34#define VOLUME_ID_VERSION 48 31#define VOLUME_ID_VERSION 48
@@ -227,6 +224,4 @@ int volume_id_probe_udf(struct volume_id *id /*,uint64_t off*/);
227 224
228int volume_id_probe_xfs(struct volume_id *id /*,uint64_t off*/); 225int volume_id_probe_xfs(struct volume_id *id /*,uint64_t off*/);
229 226
230#if __GNUC_PREREQ(4,1) 227POP_SAVED_FUNCTION_VISIBILITY
231# pragma GCC visibility pop
232#endif