summaryrefslogtreecommitdiffstats
path: root/binutils-2.25/bfd/peXXigen.c
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2015-03-18 10:57:24 +0800
committerAndrew Hsieh <andrewhsieh@google.com>2015-05-06 21:17:51 +0800
commitc39479f4ab4d372b518957871e1f205a03e7c3d6 (patch)
treec0c112647737e717933be5f838021dae71ca7b6b /binutils-2.25/bfd/peXXigen.c
parent97a8de179d86d83e05cab161566aad0e7a3281cc (diff)
downloadtoolchain_binutils-c39479f4ab4d372b518957871e1f205a03e7c3d6.tar.gz
toolchain_binutils-c39479f4ab4d372b518957871e1f205a03e7c3d6.tar.bz2
toolchain_binutils-c39479f4ab4d372b518957871e1f205a03e7c3d6.zip
Fix darwin build
1. In Drawin PTHREAD_ONCE_INIT is {0x30B1BCBA, {0}} and the GCC < 4.4 doesn't support ended initializer list 2. wcsncasecmp doesn't exist in MacSDK10.6.x Change-Id: I69204a72f853f5263dffedc448379d75ed4eca2e
Diffstat (limited to 'binutils-2.25/bfd/peXXigen.c')
-rw-r--r--binutils-2.25/bfd/peXXigen.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/binutils-2.25/bfd/peXXigen.c b/binutils-2.25/bfd/peXXigen.c
index 13e39e48..7a983066 100644
--- a/binutils-2.25/bfd/peXXigen.c
+++ b/binutils-2.25/bfd/peXXigen.c
@@ -3522,6 +3522,28 @@ u16_mbtouc (wchar_t * puc, const unsigned short * s, unsigned int n)
}
#endif /* HAVE_WCHAR_H and not Cygwin/Mingw */
+#ifdef __APPLE__
+/* wcsncasecmp isn't always defined in Mac SDK */
+static int
+wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n)
+{
+ wchar_t c1, c2;
+
+ if (n == 0)
+ return (0);
+ for (; *s1; s1++, s2++)
+ {
+ c1 = towlower(*s1);
+ c2 = towlower(*s2);
+ if (c1 != c2)
+ return ((int)c1 - c2);
+ if (--n == 0)
+ return (0);
+ }
+ return (-*s2);
+}
+#endif
+
/* Perform a comparison of two entries. */
static signed int
rsrc_cmp (bfd_boolean is_name, rsrc_entry * a, rsrc_entry * b)