[git commit] dl-string.h: change IS_IN_libdl guard to IS_IN_rtld

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Fri Jun 15 12:00:34 UTC 2012


commit: http://git.uclibc.org/uClibc/commit/?id=d5f3b8031b87fbc2d355e167c4358f28392d5c4d
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

The guard is changed to allow to be used the file in libc as well.
Include string.h (although already included by ldso.h).
Guard the rest of the file according to config options.

Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 ldso/include/dl-string.h |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/ldso/include/dl-string.h b/ldso/include/dl-string.h
index 60dfd2b..c01881c 100644
--- a/ldso/include/dl-string.h
+++ b/ldso/include/dl-string.h
@@ -23,7 +23,7 @@
 #define NULL ((void *) 0)
 #endif
 
-#ifndef IS_IN_libdl
+#ifdef IS_IN_rtld
 static __always_inline size_t _dl_strlen(const char *str)
 {
 	register const char *ptr = (char *) str-1;
@@ -198,7 +198,8 @@ static __always_inline char * _dl_get_last_path_component(char *path)
 		;/* empty */
 	return ptr == path ? ptr : ptr+1;
 }
-#else /* IS_IN_libdl */
+#else /* IS_IN_rtld */
+# include <string.h>
 # define _dl_strlen strlen
 # define _dl_strcat strcat
 # define _dl_strcpy strcpy
@@ -207,8 +208,9 @@ static __always_inline char * _dl_get_last_path_component(char *path)
 # define _dl_memcpy memcpy
 # define _dl_memcmp memcmp
 # define _dl_memset memset
-#endif /* IS_IN_libdl */
+#endif /* IS_IN_rtld */
 
+#if defined IS_IN_rtld || defined __SUPPORT_LD_DEBUG__
 /* Early on, we can't call printf, so use this to print out
  * numbers using the SEND_STDERR() macro.  Avoid using mod
  * or using long division */
@@ -226,7 +228,9 @@ static __always_inline char * _dl_simple_ltoa(char *local, unsigned long i)
 	} while (i > 0);
 	return p;
 }
+#endif
 
+#ifdef IS_IN_rtld
 static __always_inline char * _dl_simple_ltoahex(char *local, unsigned long i)
 {
 	/* 16 digits plus a leading "0x" plus a null terminator,
@@ -246,9 +250,6 @@ static __always_inline char * _dl_simple_ltoahex(char *local, unsigned long i)
 	return p;
 }
 
-
-
-
 /* The following macros may be used in dl-startup.c to debug
  * ldso before ldso has fixed itself up to make function calls */
 
@@ -342,4 +343,6 @@ static __always_inline char * _dl_simple_ltoahex(char *local, unsigned long i)
 # define SEND_ADDRESS_STDERR_DEBUG(X, add_a_newline)
 #endif
 
+#endif /* IS_IN_rtld */
+
 #endif


More information about the uClibc-cvs mailing list