Boost logo

Boost :

From: Oliver.Kowalke_at_[hidden]
Date: 2006-12-18 08:32:23


>From : Beman Dawes

> (defined(__linux) && (!defined(__USE_XOPEN2K) ||
> defined(BOOST_SYSTEM_USE_STRERROR)))

Would autocnf be integrated into boost build process we could prevent
such ugly
Preprocessor defines.
We could write:

#ifdef HAS_STRERROR_R
...
#else
...
#endif

The preprocessor define HAS_STRERROR_R could be avaluated by the m4
macro:

AC_MSG_CHECKING([for strerror_r support])
AC_CACHE_VAL(ac_cv_strerror_r,
        AC_TRY_RUN([
# include <errno.h>
# include <string.h>
# include <stdlib.h>
        main()
        {
                strerror_r(EINTR, 0, 0);
                exit( 0);
        }],
        ac_cv_strerror_r=yes,
        ac_cv_strerror_r=no,
        ac_cv_strerror_r=no))
AC_MSG_RESULT($ac_cv_strerror_r)
if test $ac_cv_strerror_r = yes; then
        AC_DEFINE([HAS_STRERROR_R],[1],[support of strerror_r])
Fi

Created config.h will contain on LINUX on HP/UX it is defined as zero

#ifndef HAS_STRERROR_R
#define HAS_STRERROR_R 1
#endif

Regards,
Oliver


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk