Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

[stable] core.stdc.stdint: Fix some aliases for Windows/MSVC #2302

Merged
merged 4 commits into from Sep 22, 2018

Conversation

kinke
Copy link
Contributor

@kinke kinke commented Sep 20, 2018

In VS 2017's stdint.h, int32_t is a typedef for int, not long; also verifiable on MSDN (incl. VS 2015). I haven't checked DMC for conformance.

This also fixes one part of issue 19249.

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @kinke! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the annotated coverage diff directly on GitHub with CodeCov's browser extension
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "stable + druntime#2302"

@kinke
Copy link
Contributor Author

kinke commented Sep 20, 2018

This was changed to long with v2.081 and used to be int before as well: 7a8eb71#diff-df39fc276ac38eb843643ec77b93a975

alias uint8_t = ubyte; ///
alias uint16_t = ushort; ///
alias int32_t = cpp_long; ///
alias uint32_t = cpp_ulong; ///
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O_o ... wow, wild ;)

@PetarKirov
Copy link
Member

Well this fails on Win32...

@PetarKirov
Copy link
Member

I think the correct fix would be to split Win32 on DMC vs MSVC.

@TurkeyMan
Copy link
Contributor

I'm surprise it's not already that way..

@kinke
Copy link
Contributor Author

kinke commented Sep 22, 2018

I'm surprise it's not already that way..

Yeah, me too, but no wonder - I hate these crappy mangling tests using a hardcoded mangle:

static assert(int32.mangleof == "?int32@@YAXJ@Z");

Proper tests consist in a .cpp and a .d file and really make sure they can be linked...

@kinke kinke changed the title [stable] core.stdc.stdint: Fix 32-bit aliases for Win32 [stable] core.stdc.stdint: Fix some aliases for Windows/MSVC Sep 22, 2018
@kinke
Copy link
Contributor Author

kinke commented Sep 22, 2018

I have 2 follow-up fixes for int_fast8_t on Win64 and [u]int_fast{8,16,32}_t on FreeBSD, which would currently break compilable/teststdint.d and require dlang/dmd#8729, which in turn requires those druntime fixes to get green.
@ZombineDev: How do you guys usually handle that chicken-and-egg problem?

@dnadlinger
Copy link
Member

For isolated tests like this, it's probably easiest to disable the failing tests in a preparatory PR, and then add them back once the fix is in.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants