aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-06-21 16:38:29 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-06-21 16:38:29 +0200
commit561f9c8585e7cb0882472297f4fd2ed763dc085a (patch)
treed7cce0d468e453674f0714c87746f90af8223f35
parent040b5a2e29743e21698d98c427fe033ffcc94eeb (diff)
downloadbusybox-w32-561f9c8585e7cb0882472297f4fd2ed763dc085a.tar.gz
busybox-w32-561f9c8585e7cb0882472297f4fd2ed763dc085a.tar.bz2
busybox-w32-561f9c8585e7cb0882472297f4fd2ed763dc085a.zip
Add HAVE_STRVERSCMP, guard the only usage of strverscmp with #ifdef
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--coreutils/ls.c2
-rw-r--r--include/platform.h5
2 files changed, 7 insertions, 0 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index c42f5f3d2..6080f59b6 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -886,9 +886,11 @@ static int sortcmp(const void *a, const void *b)
886 if (sort_opts == SORT_DIR) { 886 if (sort_opts == SORT_DIR) {
887 dif = S_ISDIR(d2->dn_mode) - S_ISDIR(d1->dn_mode); 887 dif = S_ISDIR(d2->dn_mode) - S_ISDIR(d1->dn_mode);
888 } else 888 } else
889#ifdef HAVE_STRVERSCMP && HAVE_STRVERSCMP == 1
889 if (sort_opts == SORT_VERSION) { 890 if (sort_opts == SORT_VERSION) {
890 dif = strverscmp(d1->name, d2->name); 891 dif = strverscmp(d1->name, d2->name);
891 } else 892 } else
893#endif
892 if (sort_opts == SORT_EXT) { 894 if (sort_opts == SORT_EXT) {
893 dif = strcmp(strchrnul(d1->name, '.'), strchrnul(d2->name, '.')); 895 dif = strcmp(strchrnul(d1->name, '.'), strchrnul(d2->name, '.'));
894 } 896 }
diff --git a/include/platform.h b/include/platform.h
index 429220b0d..d6b748844 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -348,6 +348,7 @@ typedef unsigned smalluint;
348#define HAVE_STRCHRNUL 1 348#define HAVE_STRCHRNUL 1
349#define HAVE_STRSEP 1 349#define HAVE_STRSEP 1
350#define HAVE_STRSIGNAL 1 350#define HAVE_STRSIGNAL 1
351#define HAVE_STRVERSCMP 1
351#define HAVE_VASPRINTF 1 352#define HAVE_VASPRINTF 1
352#define HAVE_XTABS 1 353#define HAVE_XTABS 1
353#define HAVE_MNTENT_H 1 354#define HAVE_MNTENT_H 1
@@ -372,6 +373,7 @@ typedef unsigned smalluint;
372# undef HAVE_STRCHRNUL 373# undef HAVE_STRCHRNUL
373# undef HAVE_STRSEP 374# undef HAVE_STRSEP
374# undef HAVE_STRSIGNAL 375# undef HAVE_STRSIGNAL
376# undef HAVE_STRVERSCMP
375# undef HAVE_VASPRINTF 377# undef HAVE_VASPRINTF
376# undef HAVE_NET_ETHERNET_H 378# undef HAVE_NET_ETHERNET_H
377#endif 379#endif
@@ -389,18 +391,21 @@ typedef unsigned smalluint;
389# undef HAVE_PTSNAME_R 391# undef HAVE_PTSNAME_R
390# undef HAVE_SYS_STATFS_H 392# undef HAVE_SYS_STATFS_H
391# undef HAVE_SIGHANDLER_T 393# undef HAVE_SIGHANDLER_T
394# undef HAVE_STRVERSCMP
392# undef HAVE_XTABS 395# undef HAVE_XTABS
393# undef HAVE_DPRINTF 396# undef HAVE_DPRINTF
394#endif 397#endif
395 398
396#if defined(__digital__) && defined(__unix__) 399#if defined(__digital__) && defined(__unix__)
397# undef HAVE_STPCPY 400# undef HAVE_STPCPY
401# undef HAVE_STRVERSCMP
398#endif 402#endif
399 403
400#if defined(ANDROID) 404#if defined(ANDROID)
401# undef HAVE_DPRINTF 405# undef HAVE_DPRINTF
402# undef HAVE_STPCPY 406# undef HAVE_STPCPY
403# undef HAVE_STRCHRNUL 407# undef HAVE_STRCHRNUL
408# undef HAVE_STRVERSCMP
404# undef HAVE_NET_ETHERNET_H 409# undef HAVE_NET_ETHERNET_H
405#endif 410#endif
406 411