On Jan 19 at 15:46, Thomas Dickey spoke: > On Mon, 19 Jan 2004, Hanspeter Roth wrote: > > > So should the invokation of getloadavg() be moved to a separate C > > module and then call the C function that calls getloadavg() from a > > C++ module? > > That might be a better design - it would at least get rid of the problem > of C++ breaking the configure test. Since it's not standard, there's > no guarantee that its prototype is the same across all implementations. > > The various Linux and *BSD platforms tend to make random uncoordinated > changes to the legacy BSD functions, sprinking const's in their > prototypes. It's for icewm. The Linux part is covered by another #ifdef anyway. So I'm also considering some AC_TRY_LINK check: AC_MSG_CHECKING([for getloadavg]) AC_TRY_LINK([#include <stdlib.h>], [double loadavg[3]; getloadavg(loadavg, 3) == 0;], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_GETLOADAVG, 1, [getloadavg() is available])], [ AC_MSG_RESULT(no) ]) I guess this should avoid conflicts with uncompatible getloadavg()s. (My primary intend is to support Free-, Net- and OpenBSD.) There's also AC_FUNC_GETLOADAVG. This would define C_GETLOADAVG if run by g++ 3.3. But I don't know how it behaves on platforms that have getloadavg() but on which I have no access to... -Hanspeter