This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [RFC/patch] New iteration at fixing 9533
- From: Nathan Myers <ncm-nospam at cantrip dot org>
- To: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Sun, 23 Mar 2003 02:07:52 -0800
- Subject: Re: [RFC/patch] New iteration at fixing 9533
- References: <3E7CB376.70500@unitus.it>
On Sat, Mar 22, 2003 at 08:03:18PM +0100, Paolo Carlini wrote:
>
> this is the second try.
> ...
> +dnl
> +dnl Check whether S_ISREG (Posix) or S_IFREG is available in <sys/stat.h>.
> +dnl
> +
> +AC_DEFUN(GLIBCPP_CHECK_S_ISREG_OR_S_IFREG, [
> ...
> + AC_CACHE_VAL(glibcpp_cv_S_IFREG, [
> + AC_TRY_LINK([#include <sys/stat.h>],
> + [struct stat buffer; fstat(0, &buffer); S_IFREG(buffer.st_mode); ],
> + [glibcpp_cv_S_IFREG=yes],
> + [glibcpp_cv_S_IFREG=no])
> + ])
> + if test x$glibcpp_cv_S_ISREG = xyes; then
> + AC_DEFINE(_GLIBCPP_S_ISREG_OR_S_IFREG, S_ISREG)
> + elif test x$glibcpp_cv_S_IFREG = xyes; then
> + AC_DEFINE(_GLIBCPP_S_ISREG_OR_S_IFREG, S_IFREG)
> + fi
> +])
I think S_IFREG is a regular numeric constant, so we should be testing
the expression (S_IFREG & buffer.st_mode), and the macro should (somehow)
end up as "#define _GLIBCPP_S_ISREG_OR_S_IFREG(m) (S_IFREG & (m))".
Maybe that's
AC_DEFINE(_GLIBCPP_S_ISREG_OR_S_IFREG(m), (S_IFREG & (m)))
Nathan Myers
ncm-nospam at cantrip dot org