[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cmocka under x86-64-w64-mingw32


On (05/08/15 06:59), Dejan Črnila wrote:
>I'm trying to use cmocka under 64 bit mingw compiler. However it silently
>fails.
>
>I have tracked down the issue to these lines in cmocka.h
>
># if __WORDSIZE == 64
>#  define LargestIntegralType unsigned long int
># else
>#  define LargestIntegralType unsigned long long int
># endif
>
>shouldn't be the other way around?
I don't think so.
You can try with sizeof operator.
   sizeof(unsigned long int) << should return 4 on 32 bit architecture
                                and it should return 8 on 64 bit architecture

It's not guaranted by C standard but it works on linux platforms.

What is a sizeof(unsigned long int) under 64 bit mingw compiler?
Is macro __WORDSIZE defined?

LS


Follow-Ups:
Re: cmocka under x86-64-w64-mingw32Dejan Črnila <dejan.crnila@xxxxxxxxxxxx>
References:
cmocka under x86-64-w64-mingw32Dejan Črnila <dejan.crnila@xxxxxxxxxxxx>