svn commit: trunk/busybox: include libbb
vodz at busybox.net
vodz at busybox.net
Mon Feb 20 12:15:12 UTC 2006
Author: vodz
Date: 2006-02-20 04:15:10 -0800 (Mon, 20 Feb 2006)
New Revision: 14145
Log:
remove #undef strlen, use #define strlen always but without xfunc/BB_STRLEN_IMPLEMENTATION
Modified:
trunk/busybox/include/libbb.h
trunk/busybox/libbb/xfuncs.c
Changeset:
Modified: trunk/busybox/include/libbb.h
===================================================================
--- trunk/busybox/include/libbb.h 2006-02-20 10:44:02 UTC (rev 14144)
+++ trunk/busybox/include/libbb.h 2006-02-20 12:15:10 UTC (rev 14145)
@@ -387,7 +387,9 @@
/* Stupid gcc always includes its own builtin strlen()... */
extern size_t bb_strlen(const char *string);
+#ifndef BB_STRLEN_IMPLEMENTATION
#define strlen(x) bb_strlen(x)
+#endif
char *bb_xasprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
Modified: trunk/busybox/libbb/xfuncs.c
===================================================================
--- trunk/busybox/libbb/xfuncs.c 2006-02-20 10:44:02 UTC (rev 14144)
+++ trunk/busybox/libbb/xfuncs.c 2006-02-20 12:15:10 UTC (rev 14145)
@@ -14,6 +14,13 @@
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
+
+/* Since gcc always inlines strlen(), this saves a byte or two, but we need
+ * the #undef here to avoid endless loop from #define strlen bb_strlen */
+#ifdef L_strlen
+#define BB_STRLEN_IMPLEMENTATION
+#endif
+
#include "libbb.h"
@@ -167,9 +174,6 @@
#endif
#ifdef L_strlen
-/* Since gcc always inlines strlen(), this saves a byte or two, but we need
- * the #undef here to avoid endless loop from #define strlen bb_strlen */
-#undef strlen
size_t bb_strlen(const char *string)
{
return(strlen(string));
More information about the busybox-cvs
mailing list