aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-12-16 23:49:13 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-12-16 23:49:13 +0000
commit8037e89b2e9c5a485bd57f4fe40f4659c25ca7b9 (patch)
tree6dc013e44d2281eb1e6f61c4bca1ae7546001f79 /include
parentb0ba03e9b3d460154fd09ef5676c18bf0770fdce (diff)
downloadbusybox-w32-8037e89b2e9c5a485bd57f4fe40f4659c25ca7b9.tar.gz
busybox-w32-8037e89b2e9c5a485bd57f4fe40f4659c25ca7b9.tar.bz2
busybox-w32-8037e89b2e9c5a485bd57f4fe40f4659c25ca7b9.zip
inline strcmp(s, "-") [actually macro-ize it for now - gcc is too stupid]
git-svn-id: svn://busybox.net/trunk/busybox@16977 69ca8d6d-28ef-0310-b511-8ec308f3f277
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 1d91a0a72..fcd0dfa31 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -255,6 +255,14 @@ extern char *xstrdup(const char *s);
255extern char *xstrndup(const char *s, int n); 255extern char *xstrndup(const char *s, int n);
256extern char *safe_strncpy(char *dst, const char *src, size_t size); 256extern char *safe_strncpy(char *dst, const char *src, size_t size);
257extern char *xasprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2))); 257extern 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. */