[project @ 2003-11-12 17:18:48 by sof]
authorsof <unknown>
Wed, 12 Nov 2003 17:18:49 +0000 (17:18 +0000)
committersof <unknown>
Wed, 12 Nov 2003 17:18:49 +0000 (17:18 +0000)
FP_EMPTY_STRUCTS: empty struct feature test

aclocal.m4
configure.ac

index 3d93292..7472ce3 100644 (file)
@@ -1109,4 +1109,22 @@ dnl and we don't want to be global namespace polluters.
   AC_LANG_RESTORE
 ])
 
+
+dnl @synopsis FP_EMPTY_STRUCTS
+dnl 
+dnl Check whether empty structs is accepted by CC.
+dnl
+AC_DEFUN(FP_EMPTY_STRUCTS,
+[AC_CACHE_CHECK(empty struct support, fptools_cv_empty_structs,
+[AC_TRY_COMPILE([
+typedef struct { /*empty*/ } StgFoo;
+],
+[int i;], 
+fptools_cv_empty_structs=yes,
+fptools_cv_empty_structs=no)])
+if test "$fptools_cv_empty_structs" = yes; then
+AC_DEFINE([SUPPORTS_EMPTY_STRUCTS], [1], [Define to 1 if C compiler supports declaration of empty structure types.])
+fi
+])
+
 # LocalWords:  fi
index baa2f7d..b5bdbb2 100644 (file)
@@ -1403,6 +1403,8 @@ esac
 AC_SUBST(LdCmd)
 FPTOOLS_LD_X
 
+FP_EMPTY_STRUCTS
+
 AC_MSG_CHECKING([for SIGPOLL])
 AC_EGREP_CPP(we_have_sigpoll,
 [#include <signal.h>