This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC/patch] New iteration at fixing 9533


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]