Skip to content

Use __SIZEOF_INT128__ to test __int128 presence - #39350

Merged
bors merged 1 commit into
rust-lang:masterfrom
nagisa:i128-test-helpers-better-def
Jan 28, 2017
Merged

Use __SIZEOF_INT128__ to test __int128 presence#39350
bors merged 1 commit into
rust-lang:masterfrom
nagisa:i128-test-helpers-better-def

Conversation

@nagisa

@nagisanagisa commented Jan 27, 2017

Copy link
Copy Markdown
Member

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.

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.
@rust-highfive

Copy link
Copy Markdown
Contributor

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+

@bors

bors commented Jan 27, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit 98bc300 has been approved by alexcrichton

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Jan 28, 2017
…, 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.
@est31

Copy link
Copy Markdown
Member

Very neat trick, awesome!

bors added a commit that referenced this pull request Jan 28, 2017
@bors
bors merged commit 98bc300 into rust-lang:masterJan 28, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@nagisa@rust-highfive@alexcrichton@bors@est31