diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-12-16 23:49:13 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-12-16 23:49:13 +0000 |
commit | 9f739445cd3deddd0343c3a8d5a981ede26bef30 (patch) | |
tree | 6dc013e44d2281eb1e6f61c4bca1ae7546001f79 /include | |
parent | a597aaddfa76d589d3e1a37b1f1c3401c2decffd (diff) | |
download | busybox-w32-9f739445cd3deddd0343c3a8d5a981ede26bef30.tar.gz busybox-w32-9f739445cd3deddd0343c3a8d5a981ede26bef30.tar.bz2 busybox-w32-9f739445cd3deddd0343c3a8d5a981ede26bef30.zip |
inline strcmp(s, "-") [actually macro-ize it for now - gcc is too stupid]
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h index 1d91a0a72..fcd0dfa31 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -255,6 +255,14 @@ extern char *xstrdup(const char *s); | |||
255 | extern char *xstrndup(const char *s, int n); | 255 | extern char *xstrndup(const char *s, int n); |
256 | extern char *safe_strncpy(char *dst, const char *src, size_t size); | 256 | extern char *safe_strncpy(char *dst, const char *src, size_t size); |
257 | extern char *xasprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2))); | 257 | extern char *xasprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2))); |
258 | // gcc-4.1.1 still isn't good enough at optimizing it | ||
259 | // (+200 bytes compared to macro) | ||
260 | //static ATTRIBUTE_ALWAYS_INLINE | ||
261 | //int LONE_DASH(const char *s) { return s[0] == '-' && !s[1]; } | ||
262 | //static ATTRIBUTE_ALWAYS_INLINE | ||
263 | //int NOT_LONE_DASH(const char *s) { return s[0] != '-' || s[1]; } | ||
264 | #define LONE_DASH(s) ((s)[0] == '-' && !(s)[1]) | ||
265 | #define NOT_LONE_DASH(s) ((s)[0] != '-' || (s)[1]) | ||
258 | 266 | ||
259 | /* dmalloc will redefine these to it's own implementation. It is safe | 267 | /* dmalloc will redefine these to it's own implementation. It is safe |
260 | * to have the prototypes here unconditionally. */ | 268 | * to have the prototypes here unconditionally. */ |