$OpenBSD: patch-link-grammar_utilities_h,v 1.4 2018/02/25 19:22:59 ajacoutot Exp $

Index: link-grammar/utilities.h
--- link-grammar/utilities.h.orig
+++ link-grammar/utilities.h
@@ -160,17 +160,21 @@ int strncasecmp(const char *s1, const char *s2, size_t
 /* Cygwin < 2.6.0 doesn't have locale_t. */
 #ifdef HAVE_LOCALE_T
 locale_t newlocale_LC_CTYPE(const char *);
+// XXX horrible magic to get the stubs to shut things up
+#elif defined(__clang__) && __has_include(<support/xlocale/__nop_locale_mgmt.h>)
+#include <cstddef>
+#include <support/xlocale/__nop_locale_mgmt.h>
 #else
-typedef int locale_t;
+typedef void *locale_t;
+#define freelocale(l)
+#endif
+
 #define iswupper_l(c, l) iswupper(c)
 #define iswalpha_l(c, l) iswalpha(c)
 #define iswdigit_l(c, l) iswdigit(c)
 #define iswspace_l(c, l) iswspace(c)
 #define towlower_l(c, l) towlower(c)
 #define towupper_l(c, l) towupper(c)
-#define freelocale(l)
-#endif /* HAVE_LOCALE_T */
-
 #define STR(x) #x
 #define STRINGIFY(x) STR(x)
 
