diff --git a/src/acconfig.h b/src/acconfig.h index e2a924e152262214c5387a461142dd6ebd9c33ff..f3ae6b63ecf7383ca0a5d922fe0c56797b27f26f 100644 --- a/src/acconfig.h +++ b/src/acconfig.h @@ -301,9 +301,6 @@ /* Define if you have gethostname */ #undef HAVE_GETHOSTNAME -/* Define if you have strcoll */ -#undef HAVE_STRCOLL - /* Define this if you have dlopen */ #undef HAVE_DLOPEN diff --git a/src/configure.in b/src/configure.in index 422689804bbf630941c14914d63f63ca734463f2..134820b023a9c965bf1992f1fd92c0538bf975fe 100644 --- a/src/configure.in +++ b/src/configure.in @@ -5747,21 +5747,6 @@ MY_CHECK_FUNCTION(gethostname, char *x=gethostname(buffer,sizeof(buffer)); exit(0); ]) -############################################################################# -MY_CHECK_FUNCTION(strcoll, -[ -#include <string.h> -#include <locale.h> -], [ - setlocale(LC_CTYPE, "ISO-8859-1"); - exit(strcoll("abc", "def") >= 0 || - strcoll("ABC", "DEF") >= 0 || - strcoll("ABC", "ABCD") >= 0 || - strcoll("ABCD", "ABC") <= 0 || - strcoll("*^#", "*^#") != 0 || - strcoll("123", "456") >= 0); -]) - ######################################################################## AC_MSG_CHECKING(if we can declare environ) diff --git a/src/stralloc.c b/src/stralloc.c index 86ed83889c1cc16b0deb4355f3aaea00815435f7..96a198aef6c015860d20f725135a7b9e16665ef3 100644 --- a/src/stralloc.c +++ b/src/stralloc.c @@ -1580,15 +1580,6 @@ PMOD_EXPORT int c_compare_string(struct pike_string *s, char *foo, int len) return s->len == len && s->size_shift == 0 && !memcmp(s->str,foo,len); } -#ifndef HAVE_STRCOLL -/* No locale function available */ -static int low_binary_strcmp(char *a, ptrdiff_t alen, - char *b, ptrdiff_t blen) -{ - low_quick_binary_strcmp(a,alen,b,blen); -} -#else - /* takes locale into account */ static int low_binary_strcmp(char *a, ptrdiff_t alen, char *b, ptrdiff_t blen) @@ -1608,10 +1599,8 @@ static int low_binary_strcmp(char *a, ptrdiff_t alen, if(alen > blen) return 1; return -1; } -#endif /* Does not take locale into account */ - PMOD_EXPORT ptrdiff_t my_quick_strcmp(struct pike_string *a, struct pike_string *b) { @@ -1639,7 +1628,6 @@ PMOD_EXPORT ptrdiff_t my_strcmp(struct pike_string *a,struct pike_string *b) INT32 ac=index_shared_string(a,e); INT32 bc=index_shared_string(b,e); -#ifdef HAVE_STRCOLL if(ac < 256 && bc < 256) { char atmp[2],btmp[2]; @@ -1650,9 +1638,9 @@ PMOD_EXPORT ptrdiff_t my_strcmp(struct pike_string *a,struct pike_string *b) btmp[1]=0; if((tmp=strcoll(atmp,btmp))) return tmp; - }else -#endif - if(ac-bc) return ac-bc; + } + else if(ac-bc) + return ac-bc; } return a->len - b->len; }