summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorAlain Magloire <alainm@rcsm.ee.mcgill.ca>2001-04-02 18:00:24 +0000
committerAlain Magloire <alainm@rcsm.ee.mcgill.ca>2001-04-02 18:00:24 +0000
commite13d1d9188dc408fd1287fef57f81663e3cd08cc (patch)
tree23a2485dd731b325317d3c067062413b649ed762 /m4
parent0863b3dc9bd31259a8a00a72ee43ec56935a4039 (diff)
downloadgrep-e13d1d9188dc408fd1287fef57f81663e3cd08cc.tar.gz
support for wchar_t
Diffstat (limited to 'm4')
-rw-r--r--m4/Makefile.am1
-rw-r--r--m4/mbstate_t.m429
2 files changed, 30 insertions, 0 deletions
diff --git a/m4/Makefile.am b/m4/Makefile.am
index ec93d4bd..28438a45 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -16,6 +16,7 @@ EXTRA_DIST = decl.m4 \
largefile.m4 \
lcmessage.m4 \
malloc.m4 \
+ mbstate_t.m4 \
missing.m4 \
progtest.m4 \
realloc.m4 \
diff --git a/m4/mbstate_t.m4 b/m4/mbstate_t.m4
new file mode 100644
index 00000000..a185a7db
--- /dev/null
+++ b/m4/mbstate_t.m4
@@ -0,0 +1,29 @@
+# serial 8
+
+# From Paul Eggert.
+
+# BeOS 5 has <wchar.h> but does not define mbstate_t,
+# so you can't declare an object of that type.
+# Check for this incompatibility with Standard C.
+
+# Include stdlib.h first, because otherwise this test would fail on Linux
+# (at least glibc-2.1.3) because the "_XOPEN_SOURCE 500" definition elicits
+# a syntax error in wchar.h due to the use of undefined __int32_t.
+
+AC_DEFUN(AC_MBSTATE_T,
+ [
+ AC_CHECK_HEADERS(stdlib.h)
+
+ AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
+ [AC_TRY_COMPILE([
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+#include <wchar.h>],
+ [mbstate_t x; return sizeof x;],
+ ac_cv_type_mbstate_t=yes,
+ ac_cv_type_mbstate_t=no)])
+ if test $ac_cv_type_mbstate_t = no; then
+ AC_DEFINE(mbstate_t, int,
+ [Define to a type if <wchar.h> does not define.])
+ fi])