configure: improve detection of wchar_t
authorMichael Wallner <mike@php.net>
Fri, 15 Apr 2016 09:38:44 +0000 (11:38 +0200)
committerMichael Wallner <mike@php.net>
Fri, 15 Apr 2016 09:38:44 +0000 (11:38 +0200)
m4/stddef.m4

index b6ee82e16f6bec644fbf2d10be863fee4b2a2f70..fd52d2a1c8228ac8d8a9d5fddfc351c09d2b7a2c 100644 (file)
@@ -6,6 +6,13 @@ PSI_CHECK_STDDEF() {
     PSI_TYPE(size_t, uint)
     PSI_CONST(SIZE_MAX, int)
     PSI_TYPE(wchar_t, int)
+    if PSI_SH_TEST_SIZEOF(wchar_t); then :; else
+       # some platforms fail to provide wchar_t in stddef.h
+       unset ac_cv_sizeof_wchar_t
+       unset ax_cv_decl_wchar_t_signed
+       AC_CHECK_HEADERS(wchar.h)
+       PSI_TYPE(wchar_t, int)
+    fi
     PSI_CONST(WCHAR_MIN, int)
     PSI_CONST(WCHAR_MAX, int)
 }