PDA

View Full Version : where is u_int32_t defined?


ta0kira
January 6th, 2010, 02:48
I've been programming on Linux for several years, but I'm pretty new to FreeBSD. In <netinet/in.h> the macro INADDR_LOOPBACK uses the type u_int32_t; however, some other header must be included for that typedef and I don't know which one. My solution at the moment is to #define u_int32_t uint32_t in case it's already defined as a typedef on some other machine that I wish to compile on (solves the problem where it exists and it's still safe where there isn't a problem.) I grepped the entire tree of /usr/include and nothing seems to define it. FreeBSD 8.0 amd64, in case you're wondering, but it's been a problem on previous releases. Thanks!
Kevin Barry

crsd
January 6th, 2010, 03:02
egrep -r 'typedef.*u_int32_t;' /usr/include/ :)

ta0kira
January 6th, 2010, 03:30
Thanks. For some reason I thought .+ (which I used in a similar search) wasn't an extended expression. Seems silly in retrospect.
Kevin Barry

redbrain
February 11th, 2010, 00:59
stdint.h? Not sure thats a bit random u_int32_t lol why don't they just use the more common uint32_t