autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using AC_REPLACE_FUNCS


From: Nicolas Blais
Subject: Using AC_REPLACE_FUNCS
Date: Wed, 25 May 2005 17:55:11 -0400
User-agent: KMail/1.8

Hi,

I'm currently developping a C++ software on FreeBSD. Since that software uses 
stdlib.h's srandomdev() function, I added :

AC_CHECK_FUNCS([srandomdev]) 

in my configure.in file to detect it. The problem is that on other oses such 
as Debian, there is no srandomdev() function in stdlib.h so I must use 
srandom() which is close enough.

I do this by changing my software's code to the following:

#ifdef HAVE_SRANDOMDEV
  srandomdev();
#endif
#ifndef HAVE_SRANDOMDEV
  srandom(time(0));
#endif

I'm hoping there is a better way to do this by using AC_REPLACE_FUNCS, but I 
can't seem to have it working. I'm trying to replace srandomdev() by 
srandom() from the same stdlib.h but it doesn't seem to work. 

Could someone be kind enough to post an example?

Thanks,
Nicolas

-- 
FreeBSD 6.0-CURRENT #2: Sun May 22 11:29:47 EDT 2005     
address@hidden:/usr/obj/usr/src/sys/CLK01A 
PGP? : http://66.130.198.54:8081/security/nb_root.asc

Attachment: pgpUt_vPs4H_T.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]