is PRIdu4 some sort of built-in macro?
I will probably use the %Iu since it works with either platform and most
implementations use size_t for their definitions of size_type (but not
everything is in g++!).
I tried
find . -exec egrep "typedef[ \t].*[ \t]size_type;" {} ; -print
and got some very interesting answers...
>________________________________
> From: JonY <[email protected]>
>To: [email protected]
>Sent: Thursday, February 9, 2012 3:36 PM
>Subject: Re: [Mingw-w64-public] sizeof(size_t) on 64-bit systems with auto
>build?
>
>On 2/10/2012 07:14, Jim Michaels wrote:
>>
>> hi...
>>
>> does anyone know what sizeof(size_t) is in 64-bit systems?
>>
>> #include <iostream>
>> #include <string>
>> using namespace std;
>> int main(void) {
>> cout<<sizeof(size_t)<<endl;
>> return 0;
>> }
>>
>> this needs to be run on a 64-bit system. I have a 32-bit system. I could
>> use the help. I use the auto build.
>>
>> the help is appreciated. on a 32-bit system, this program prints out 4. IF
>> it prints out 8 on a 64-bit system, I have a problem to address, and I need
>> to stuff in a lot of #ifdefs
>> because fprintf is unforgiving of data
>> types (I can only think of %I64u and %lu, no resizeable size_t data types),
>>and I have no clue how to switch streams between cout and ostream safely.
>
>have you tried up casting it to 64bit regardless of platform?
>
>printf("%"PRIdu4"\n",uint64_t(my_size_t));
>
>
>
>------------------------------------------------------------------------------
>Virtualization & Cloud Management Using Capacity Planning
>Cloud computing makes use of virtualization - but cloud computing
>also focuses on allowing computing to be delivered as a service.
>http://www.accelacomm.com/jaw/sfnl/114/51521223/
>_______________________________________________
>Mingw-w64-public mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
>
>------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public