]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Work around missing wmemcmp()
authorTim Kientzle <kientzle@gmail.com>
Sat, 22 Jan 2011 07:35:58 +0000 (02:35 -0500)
committerTim Kientzle <kientzle@gmail.com>
Sat, 22 Jan 2011 07:35:58 +0000 (02:35 -0500)
SVN-Revision: 2934

libarchive/archive_acl.c

index 40bd7b5b74f25cb93d6776590059dfc0bdbada48..41591766211cfca6d163e69638265d0e76ac6a0f 100644 (file)
@@ -29,6 +29,9 @@ __FBSDID("$FreeBSD$");
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
 #endif
+#ifdef HAVE_WCHAR_H
+#include <wchar.h>
+#endif
 
 #include "archive_acl_private.h"
 #include "archive_entry.h"
@@ -37,6 +40,11 @@ __FBSDID("$FreeBSD$");
 #undef max
 #define        max(a, b)       ((a)>(b)?(a):(b))
 
+#ifndef HAVE_WMEMCMP
+/* Good enough for simple equality testing, but not for sorting. */
+#define wmemcmp(a,b,i)  memcmp((a), (b), (i) * sizeof(wchar_t))
+#endif
+
 static int     acl_special(struct archive_acl *acl,
                    int type, int permset, int tag);
 static struct archive_acl_entry *acl_new_entry(struct archive_acl *acl,