aboutsummaryrefslogtreecommitdiff
path: root/ac/check-type.m4
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-01-12 11:22:08 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-01-12 11:22:08 +0000
commitb9ca7b1ef5cd1f96ae6e28ae78d12c1e3258c23f (patch)
tree1203adec5f70af1ddd49868528d8d3a5b9004329 /ac/check-type.m4
Initial import of Sylpheed (GTK2 version).
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'ac/check-type.m4')
-rw-r--r--ac/check-type.m427
1 files changed, 27 insertions, 0 deletions
diff --git a/ac/check-type.m4 b/ac/check-type.m4
new file mode 100644
index 00000000..90611451
--- /dev/null
+++ b/ac/check-type.m4
@@ -0,0 +1,27 @@
+dnl SYLPHEED_CHECK_TYPE(TYPE, DEFAULT [, INCLUDES, COMMENT])
+dnl
+dnl Like AC_CHECK_TYPE, but in addition to `sys/types.h', `stdlib.h' and
+dnl `stddef.h' checks files included by INCLUDES, which should be a
+dnl series of #include statements. If TYPE is not defined, define it
+dnl to DEFAULT.
+dnl
+AC_DEFUN(SYLPHEED_CHECK_TYPE,
+[AC_REQUIRE([AC_HEADER_STDC])dnl
+AC_MSG_CHECKING(for $1)
+AC_CACHE_VAL(sylpheed_cv_type_$1,
+[AC_TRY_COMPILE([
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+$3
+], [
+#undef $1
+int a = sizeof($1);
+], sylpheed_cv_type_$1=yes, sylpheed_cv_type_$1=no)])dnl
+AC_MSG_RESULT($sylpheed_cv_type_$1)
+if test $sylpheed_cv_type_$1 = no; then
+ AC_DEFINE($1, $2, $4)
+fi
+])