[ On Wednesday, June 8, 2005 at 15:31:56 (+0200), Michael Haardt wrote: ]
> Subject: Re: [exim] Quota over 2GB supported?
>
> Indeed, C sucks when it comes to off_t and time_t. There is no way to
> express literals for those types, either. I don't know if C99 changes
> any of that.
You don't need C99 to make printf()'s portable for integer types that
might have different widths on different platforms -- only C89! :-)
... or at least support in the compiler for concatenating adjacent
strings.
C99 does make this easier by requiring standard macro definitions for
format specifiers, but you can still define your own:
in some application-specific portability header:
#ifdef OFF_T_IS_LONG_LONG
# define MY_OFF_T_FMT "%lld"
#endif
#ifdef OFF_T_IS_LONG
# define MY_OFF_T_FMT "%ld"
#endif
and then in the code:
printf("off_t value is: " MY_OFF_T_FMT ".\n", (off_t) foo);
(BTW, ``Just say NO to operating systems with "LARGE FILE SUPPORT"!!!!''
What a stupid idea that was just to appease the bass-ackwards ABI
nutcases.)
--
Greg A. Woods
H:+1 416 218-0098 W:+1 416 489-5852 x122 VE3TCP RoboHack <woods@???>
Planix, Inc. <woods@???> Secrets of the Weird <woods@???>