summaryrefslogtreecommitdiff
path: root/include/libbb.h
diff options
context:
space:
mode:
authorDenis Vlasenko2008-05-09 17:59:34 +0000
committerDenis Vlasenko2008-05-09 17:59:34 +0000
commit98636eb08c5ecc216e18970e11f7021206ac9b04 (patch)
treedfc70b7c6bf6276776c4e8198457dcf2df1e09fb /include/libbb.h
parent50dbed95fb7c0a97135b771385160ca26c377a15 (diff)
downloadbusybox-98636eb08c5ecc216e18970e11f7021206ac9b04.zip
busybox-98636eb08c5ecc216e18970e11f7021206ac9b04.tar.gz
Use intra-DSO calls when we build libbusybox. No-op for normal build.
This was Bernhard Fischer' idea. text data bss dec hex filename 773549 7781 9740 791070 c121e busybox.t7/0_lib/libbusybox.so.1.11.0.svn_unstripped 769683 7397 9740 786820 c0184 busybox.t9t/0_lib/libbusybox.so.1.11.0.svn_unstripped
Diffstat (limited to 'include/libbb.h')
-rw-r--r--include/libbb.h42
1 files changed, 33 insertions, 9 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 281152f..09dcc1b 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -65,15 +65,21 @@
#define setlocale(x,y) ((void)0)
#endif
-#include "pwd_.h"
-#include "grp_.h"
-/* ifdef it out, because it may include <shadow.h> */
-/* and we may not even _have_ <shadow.h>! */
+#ifdef DMALLOC
+#include <dmalloc.h>
+#endif
+
+#if !ENABLE_USE_BB_PWD_GRP
+# include <pwd.h>
+# include <grp.h>
+#endif
#if ENABLE_FEATURE_SHADOWPASSWDS
-#include "shadow_.h"
+# if !ENABLE_USE_BB_SHADOW
+# include <shadow.h>
+# endif
#endif
-/* Some libc's don't declare it, help them */
+/* Some libc's forget to declare these, help them */
extern char **environ;
#if defined(__GLIBC__) && __GLIBC__ < 2
@@ -106,6 +112,23 @@ struct sysinfo {
int sysinfo(struct sysinfo* info);
+/* Make all declarations hidden (-fvisibility flag only affects definitions) */
+/* (don't include system headers after this until corresponding pop!) */
+#if __GNUC_PREREQ(4,1)
+# pragma GCC visibility push(hidden)
+#endif
+
+
+#if ENABLE_USE_BB_PWD_GRP
+# include "pwd_.h"
+# include "grp_.h"
+#endif
+#if ENABLE_FEATURE_SHADOWPASSWDS
+# if ENABLE_USE_BB_SHADOW
+# include "shadow_.h"
+# endif
+#endif
+
/* Tested to work correctly with all int types (IIRC :]) */
#define MAXINT(T) (T)( \
((T)-1) > 0 \
@@ -1344,11 +1367,12 @@ extern const char bb_default_login_shell[];
#undef isdigit
#define isdigit(a) ((unsigned)((a) - '0') <= 9)
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-#ifdef DMALLOC
-#include <dmalloc.h>
+
+#if __GNUC_PREREQ(4,1)
+# pragma GCC visibility pop
#endif
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#endif /* __LIBBUSYBOX_H__ */