Add: [OSX] Native natural sort implementation.
This commit is contained in:
@@ -33,6 +33,10 @@
|
||||
#include "os/windows/string_uniscribe.h"
|
||||
#endif
|
||||
|
||||
#if defined(WITH_COCOA)
|
||||
#include "os/macosx/string_osx.h"
|
||||
#endif
|
||||
|
||||
#ifdef WITH_ICU_SORT
|
||||
/* Required by strnatcmp. */
|
||||
#include <unicode/ustring.h>
|
||||
@@ -593,6 +597,11 @@ int strnatcmp(const char *s1, const char *s2, bool ignore_garbage_at_front)
|
||||
if (res != 0) return res - 2; // Convert to normal C return values.
|
||||
#endif
|
||||
|
||||
#if defined(WITH_COCOA) && !defined(STRGEN) && !defined(SETTINGSGEN)
|
||||
int res = MacOSStringCompare(s1, s2);
|
||||
if (res != 0) return res - 2; // Convert to normal C return values.
|
||||
#endif
|
||||
|
||||
/* Do a normal comparison if ICU is missing or if we cannot create a collator. */
|
||||
return strcasecmp(s1, s2);
|
||||
}
|
||||
|
Reference in New Issue
Block a user