macro_x madness heads up

Ton Voon tonvoon at gmail.com
Fri Nov 5 12:12:52 CET 2010


On 5 Nov 2010, at 09:45, Andreas Ericsson wrote:

> Using this completely untested program, what output do you get?
>
> #include <sys/types.h>
> #include <stdio.h>
> #include <unistd.h>
> #define psize(type) printf("sizeof(" #type ") = %d\n", sizeof(type))
>
> int main(int argc, char **argv)
> {
> 	psize(time_t);
> 	psize(__darwin_suseconds_t);
> 	psize(int);
> 	psize(long);
> 	psize(off_t);
> 	psize(void *);
> 	psize(long long);
> 	return 0;
> }

I get:

$ ./a.out
sizeof(time_t) = 4
sizeof(__darwin_suseconds_t) = 4
sizeof(int) = 4
sizeof(long) = 4
sizeof(off_t) = 8
sizeof(void *) = 4
sizeof(long long) = 8

macbook 10.5, 32bit.

Ton


------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev




More information about the Developers mailing list