What I do for CUPS is #define two constants for the printf format and any
needed cast:
#ifdef HAVE_LONG_LONG
# define CUPS_LLFMT "%lld"
# define CUPS_LLCAST (long long)
#else
# define CUPS_LLFMT "%ld"
# define CUPS_LLCAST (long)
#endif /* HAVE_LONG_LONG */
Then any debug (or otherwise) printfs can use:
size_t big;
printf("Something big: " CUPS_LLFMT "\n", CUPS_LLCAST big);
On Mar 19, 2010, at 3:38 PM, "none <"@easysw.com, "ff\""@>.easysw.com (none)
wrote:
> Greg Ercolano schrieb:
>> none wrote:
>>> btw. printing size_t and off_t is still not portable
>>> printf("size=%zu offset=%16jx"\n",size_t_var,off_t_var);
>>
>> I've never seen the 'z' flag before.. is that a windows thing?
>
> afaict %zu works fine with gcc.
> (did i mention printf debugging?)
> G.
> _______________________________________________
> fltk-dev mailing list
> [email protected]
> http://lists.easysw.com/mailman/listinfo/fltk-dev
________________________________________
Michael Sweet, Easy Software Products
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev