diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2012-06-25 18:07:04 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2012-06-25 18:07:04 +0400 |
commit | 3511c7847949ea1d53a32cf9327c0e02d2191f3d (patch) | |
tree | 9370b7a199654a28179375c254220a304e7bc530 /lwlib/lwlib.c | |
parent | fb7da12e7560ce31fc88f829cff94723c3bbc5fa (diff) | |
download | emacs-3511c7847949ea1d53a32cf9327c0e02d2191f3d.tar.gz |
* configure.in (AC_CHECK_FUNCS): Detect library functions
strcasecmp and strncasecmp.
* lib-src/etags.c (etags_strcasecmp, etags_strncasecmp): Define to
library functions strcasecmp and strncasecmp if available.
* lwlib/lwlib.c (my_strcasecmp): Rename to lwlib_strcasecmp, which
may be defined to library function strcasecmp if available.
* src/dispextern.c (xstrcasecmp): Define to library function
strcasecmp if available.
* src/xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
Diffstat (limited to 'lwlib/lwlib.c')
-rw-r--r-- | lwlib/lwlib.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lwlib/lwlib.c b/lwlib/lwlib.c index 49c1b8df2e6..d1686ecd048 100644 --- a/lwlib/lwlib.c +++ b/lwlib/lwlib.c @@ -75,7 +75,6 @@ static widget_value *merge_widget_value (widget_value *, widget_value *, int, int *); static void instantiate_widget_instance (widget_instance *); -static int my_strcasecmp (const char *, const char *); static void safe_free_str (char *); static void free_widget_value_tree (widget_value *); static widget_value *copy_widget_value_tree (widget_value *, @@ -115,10 +114,14 @@ safe_strdup (const char *s) return result; } +#ifdef HAVE_STRCASECMP +#define lwlib_strcasecmp(x,y) strcasecmp ((x), (y)) +#else + /* Like strcmp but ignore differences in case. */ static int -my_strcasecmp (const char *s1, const char *s2) +lwlib_strcasecmp (const char *s1, const char *s2) { while (1) { @@ -134,6 +137,7 @@ my_strcasecmp (const char *s1, const char *s2) return 0; } } +#endif /* HAVE_STRCASECMP */ static void safe_free_str (char *s) @@ -731,7 +735,7 @@ find_in_table (const char *type, const widget_creation_entry *table) { const widget_creation_entry* cur; for (cur = table; cur->type; cur++) - if (!my_strcasecmp (type, cur->type)) + if (!lwlib_strcasecmp (type, cur->type)) return cur->function; return NULL; } |