mirror of
https://github.com/sheumann/hush.git
synced 2024-09-12 00:55:11 +00:00
remove #undef strlen, use #define strlen always but without xfunc/BB_STRLEN_IMPLEMENTATION
This commit is contained in:
parent
d24d083061
commit
0c6ff43a0c
@ -387,7 +387,9 @@ void reset_ino_dev_hashtable(void);
|
|||||||
|
|
||||||
/* Stupid gcc always includes its own builtin strlen()... */
|
/* Stupid gcc always includes its own builtin strlen()... */
|
||||||
extern size_t bb_strlen(const char *string);
|
extern size_t bb_strlen(const char *string);
|
||||||
|
#ifndef BB_STRLEN_IMPLEMENTATION
|
||||||
#define strlen(x) bb_strlen(x)
|
#define strlen(x) bb_strlen(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
char *bb_xasprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
|
char *bb_xasprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
|
||||||
|
|
||||||
|
@ -14,6 +14,13 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.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"
|
#include "libbb.h"
|
||||||
|
|
||||||
|
|
||||||
@ -167,9 +174,6 @@ extern void bb_xfflush_stdout(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef L_strlen
|
#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)
|
size_t bb_strlen(const char *string)
|
||||||
{
|
{
|
||||||
return(strlen(string));
|
return(strlen(string));
|
||||||
|
Loading…
Reference in New Issue
Block a user