Skip to content

Commit

Permalink
Rollup merge of rust-lang#39350 - nagisa:i128-test-helpers-better-def…
Browse files Browse the repository at this point in the history
…, r=alexcrichton

Use __SIZEOF_INT128__ to test __int128 presence

Previously we tested whether a handful of preprocessor variables indicating certain 64 bit
platforms, but this does not work for other 64 bit targets which have support for __int128 in C
compiler.

Use the `__SIZEOF__INT128__` preprocessor variable instead. This variable gets set to 16 by gcc and
clang for every target where __int128 is supported.
  • Loading branch information
alexcrichton committed Jan 28, 2017
2 parents ebe17b0 + 98bc300 commit 9eb0068
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rt/rust_test_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ LARGE_INTEGER increment_all_parts(LARGE_INTEGER li) {
return li;
}

#if !(defined(WIN32) || defined(_WIN32) || defined(__WIN32)) && defined(__amd64__)
#if __SIZEOF_INT128__ == 16

unsigned __int128 identity(unsigned __int128 a) {
return a;
Expand Down

0 comments on commit 9eb0068

Please sign in to comment.