Use the address-of operator when checking for weak symbols

This fixes a warning with gcc on OS X
This commit is contained in:
ridiculousfish 2015-07-25 13:02:58 -07:00
parent a91e8887cd
commit 1786a7cdc4

View file

@ -861,21 +861,21 @@ static int wcsncasecmp_fallback(const wchar_t *a, const wchar_t *b, size_t count
/* Note parens avoid the macro expansion */ /* Note parens avoid the macro expansion */
wchar_t *wcsdup_use_weak(const wchar_t *a) wchar_t *wcsdup_use_weak(const wchar_t *a)
{ {
if (wcsdup != NULL) if (&wcsdup != NULL)
return (wcsdup)(a); return (wcsdup)(a);
return wcsdup_fallback(a); return wcsdup_fallback(a);
} }
int wcscasecmp_use_weak(const wchar_t *a, const wchar_t *b) int wcscasecmp_use_weak(const wchar_t *a, const wchar_t *b)
{ {
if (wcscasecmp != NULL) if (&wcscasecmp != NULL)
return (wcscasecmp)(a, b); return (wcscasecmp)(a, b);
return wcscasecmp_fallback(a, b); return wcscasecmp_fallback(a, b);
} }
int wcsncasecmp_use_weak(const wchar_t *s1, const wchar_t *s2, size_t n) int wcsncasecmp_use_weak(const wchar_t *s1, const wchar_t *s2, size_t n)
{ {
if (wcsncasecmp != NULL) if (&wcsncasecmp != NULL)
return (wcsncasecmp)(s1, s2, n); return (wcsncasecmp)(s1, s2, n);
return wcsncasecmp_fallback(s1, s2, n); return wcsncasecmp_fallback(s1, s2, n);
} }