[Bro] Problems compiling with --enable-int64

Joel Ebrahimi joel.ebrahimi at gmail.com
Tue Apr 15 20:10:04 PDT 2008


I didnt think about the port aspect(not much experience).
Definately not the way to maintain a build of somethign that would work
across all OS's
And in most cases there probably be a difference in bytes (4 vs 8) on most
OS's anyways.

An #ifdef would be the way to go, but my said typecasting would not be good
for a port.
Looks like there are different functions for calculating absolute zero on
different OS's.

Check your headers for llabs.

This might be the way to go for portability

try swapping:
   return new Val(abs(val.int_val), TYPE_COUNT);

for:
#ifdef USE_INT64
    return new Val(llabs(val.int_val), TYPE_COUNT);
#else
    return new Val(abs(val.int_val), TYPE_COUNT);
#endif

It may be better to define this function in a header but you can see if this
works.
// Joel
On Tue, Apr 15, 2008 at 8:42 PM, Paul Schmehl <pauls at utdallas.edu> wrote:

> --On April 15, 2008 9:07:28 PM -0500 Paul Schmehl <pauls at utdallas.edu>
> wrote:
> >
> > I don't know the size of a long int on my system, but I'm almost certain
> > that it won't be the same on *every* system.
> >
>
> Here's what I have in my includes:
>
> /usr/src/sys/i386/include/_types.h:typedef      long long
> __int64_t;
> /usr/src/sys/i386/include/_types.h:typedef      unsigned long long
> __uint64_t;
> /usr/src/sys/i386/include/_types.h:typedef      long long
> __int64_t;
> /usr/src/sys/i386/include/_types.h:typedef      unsigned long long
> __uint64_t;
>
> Fixing the function per your instructions allows the software to make
> successfully.  I'm concerned, however, about your second point.  If I
> change the define in util.h, will it break on some FreeBSD systems?  I
> don't know.
>
> According to the cvs repository, _inttypes.h hasn't been changed in almost
> six years on i386.
> <http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/i386/include/_inttypes.h>
> It's been almost 5 years on amd64 and 5 years on ia64.
>
> I guess I'm alright to redefine in util.h.
>
> Paul Schmehl (pauls at utdallas.edu)
> Senior Information Security Analyst
> The University of Texas at Dallas
> http://www.utdallas.edu/ir/security/
>
> _______________________________________________
> Bro mailing list
> bro at bro-ids.org
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/bro<http://mailman.icsi.berkeley.edu/mailman/listinfo/bro>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ICSI.Berkeley.EDU/pipermail/bro/attachments/20080415/675d98ea/attachment.html 


More information about the Bro mailing list