__uint128_t on mingw gcc

I am trying to compile a c program under mingw gcc. This program uses the integer __uint128_t . When I try to compile it under the standard ubuntu gcc on the same 64-bit machine, it works fine. But then when I try to compile it for windows under mingw, it just doesn't recognize the __uint128_t keyword. What does it mean? There are no 128 bit integers in mingw? If not, is there any programming language for windows that have built-in (and FAST) 128-bit integers?

+7
source share
3 answers

You need

  • relatively recent version of gcc
  • version compiled with native support for 64-bit integer

__int128_t then emulated using int64_t pairs in the same way that 64-bit integers are emulated with 32-bit if they are not available in 32-bit compilers

+5
source

I managed to get the same problem using Code :: Blocks and the default installation of mingw (which is IA32 btw), however when I installed TDM-MinGW64 it compiled fine (after adding the x64 compiler to C :: B). So make sure your mingw build is x64-oriented (with -m64 ) and this is the x64 mingw build, since __uint128_t is an optional x64 ABI extension.

any Windows IDE you use will not take __int128_t as a keyword, although as its special GCC extension (as indicated).

+5
source

But then when I try to compile it for windows under mingw, it just does not recognize the __uint128_t keyword. What does it mean? There are no 128 bit integers with mingw?

Run gcc -dM -E - < /dev/null | grep INT128 gcc -dM -E - < /dev/null | grep INT128 . If it issues the macro #define __SIZEOF_INT128__ 16 , then __uint128_t is available. If it does not display a macro or it is less than 16, then __uint128_t not available.

Also see a 128-bit integer - meaningless documentation? on the GCC user mailing list.

0
source

All Articles