<div>I didnt think about the port aspect(not much experience).</div>
<div>Definately not the way to maintain a build of somethign that would work across all OS's</div>
<div>And in most cases there probably be a difference in bytes (4 vs 8) on most OS's anyways.</div>
<div> </div>
<div>An #ifdef would be the way to go, but my said typecasting would not be good for a port. </div>
<div>Looks like there are different functions for calculating absolute zero on different OS's. </div>
<div> </div>
<div>Check your headers for llabs.</div>
<div> </div>
<div>This might be the way to go for portability</div>
<div> </div>
<div>try swapping:</div>
<div> return new Val(abs(val.int_val), TYPE_COUNT);</div>
<div> </div>
<div>for:<br>#ifdef USE_INT64</div>
<div> return new Val(llabs(val.int_val), TYPE_COUNT);</div>
<div>#else</div>
<div> return new Val(abs(val.int_val), TYPE_COUNT);</div>
<div>#endif</div>
<div> </div>
<div>It may be better to define this function in a header but you can see if this works.<br></div>
<div>// Joel <br></div>
<div class="gmail_quote">On Tue, Apr 15, 2008 at 8:42 PM, Paul Schmehl <<a href="mailto:pauls@utdallas.edu">pauls@utdallas.edu</a>> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">--On April 15, 2008 9:07:28 PM -0500 Paul Schmehl <<a href="mailto:pauls@utdallas.edu">pauls@utdallas.edu</a>><br>
wrote:<br>
<div class="Ih2E3d">><br>> I don't know the size of a long int on my system, but I'm almost certain<br>> that it won't be the same on *every* system.<br>><br><br></div>Here's what I have in my includes:<br>
<br>/usr/src/sys/i386/include/_types.h:typedef long long<br>__int64_t;<br>/usr/src/sys/i386/include/_types.h:typedef unsigned long long<br>__uint64_t;<br>/usr/src/sys/i386/include/_types.h:typedef long long<br>
__int64_t;<br>/usr/src/sys/i386/include/_types.h:typedef unsigned long long<br>__uint64_t;<br><br>Fixing the function per your instructions allows the software to make<br>successfully. I'm concerned, however, about your second point. If I<br>
change the define in util.h, will it break on some FreeBSD systems? I<br>don't know.<br><br>According to the cvs repository, _inttypes.h hasn't been changed in almost<br>six years on i386.<br><<a href="http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/i386/include/_inttypes.h" target="_blank">http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/i386/include/_inttypes.h</a>><br>
It's been almost 5 years on amd64 and 5 years on ia64.<br><br>I guess I'm alright to redefine in util.h.<br>
<div>
<div></div>
<div class="Wj3C7c"><br>Paul Schmehl (<a href="mailto:pauls@utdallas.edu">pauls@utdallas.edu</a>)<br>Senior Information Security Analyst<br>The University of Texas at Dallas<br><a href="http://www.utdallas.edu/ir/security/" target="_blank">http://www.utdallas.edu/ir/security/</a><br>
<br>_______________________________________________<br>Bro mailing list<br><a href="mailto:bro@bro-ids.org">bro@bro-ids.org</a><br><a href="http://mailman.icsi.berkeley.edu/mailman/listinfo/bro" target="_blank">http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/bro</a><br>
</div></div></blockquote></div><br>