Problem compiling nagios 2.3.1
Andreas Ericsson
ae at op5.se
Wed May 17 13:11:46 CEST 2006
Andreas Ericsson wrote:
> Andrea Gabellini wrote:
>
>> Hi,
>>
>> I'm using various solaris versions, from 5.7 to 5.10.
>>
>> An usable header file is iso/limits_iso.h except for solaris 5.7 where
>> the header fiele is limits.h.
>>
>> As a workaround I'm using, in cgi/getcgi.c:
>>
>> #ifndef INT_MAX
>> #define INT_MAX 2147483647
>> #endif
>>
>
> A more portable way is to write
>
> #ifndef CHAR_BIT
> # define CHAR_BIT 8 /* true for any system created post-woodstock */
> #endif
> #ifndef INT_MAX
> # define INT_MAX (1 < ((sizeof(int) * CHAR_BIT) - 1))
> #endif
>
gaah! dangerous to write code in emails just after lunch.
#define INT_MAX (~(1 << (sizeof(int) * CHAR_BIT) - 1))
is the correct way. Sorry if I caused any confusion.
--
Andreas Ericsson andreas.ericsson at op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
More information about the Developers
mailing list