summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenis Vlasenko2006-12-16 23:49:13 +0000
committerDenis Vlasenko2006-12-16 23:49:13 +0000
commit9f739445cd3deddd0343c3a8d5a981ede26bef30 (patch)
tree6dc013e44d2281eb1e6f61c4bca1ae7546001f79 /include
parenta597aaddfa76d589d3e1a37b1f1c3401c2decffd (diff)
downloadbusybox-9f739445cd3deddd0343c3a8d5a981ede26bef30.zip
busybox-9f739445cd3deddd0343c3a8d5a981ede26bef30.tar.gz
inline strcmp(s, "-") [actually macro-ize it for now - gcc is too stupid]
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 1d91a0a..fcd0dfa 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -255,6 +255,14 @@ extern char *xstrdup(const char *s);
extern char *xstrndup(const char *s, int n);
extern char *safe_strncpy(char *dst, const char *src, size_t size);
extern char *xasprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
+// gcc-4.1.1 still isn't good enough at optimizing it
+// (+200 bytes compared to macro)
+//static ATTRIBUTE_ALWAYS_INLINE
+//int LONE_DASH(const char *s) { return s[0] == '-' && !s[1]; }
+//static ATTRIBUTE_ALWAYS_INLINE
+//int NOT_LONE_DASH(const char *s) { return s[0] != '-' || s[1]; }
+#define LONE_DASH(s) ((s)[0] == '-' && !(s)[1])
+#define NOT_LONE_DASH(s) ((s)[0] != '-' || (s)[1])
/* dmalloc will redefine these to it's own implementation. It is safe
* to have the prototypes here unconditionally. */