Skip to content

Adding the correct value for __swift_mode_t in Android. #14636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

gonzalolarralde
Copy link
Contributor

As defined(__linux__) also matches, this never gets to the final else case. The lack of this line is causing the following static assert to fail.

#if defined(__linux__)
#if defined(__ANDROID__)
typedef __swift_uint16_t __swift_mode_t;
#elif defined(__linux__)
Copy link
Member

Choose a reason for hiding this comment

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

This feels a bit fragile to me. This may seem stylistic and silly, but, I feel that if someone were to accidentally reorder the items, this would break. Writing it as the following would make that more visible:

  #if defined(__linux__)
  # if defined(__ANDROID__)
  typedef __swift_uint16_t __swift_mode_t;
  # else
  typedef __swift_uint32_t __swift_mode_t;
  # endif
  #else

Copy link
Contributor Author

Choose a reason for hiding this comment

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

absolutely, doing that change now! I'll keep this mind for the next changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@compnerd got it, done. I'll put a note to do a cleanup PR later fixes all the other occurrences (or as much as possible w/o breaking anything :) )

@gonzalolarralde gonzalolarralde force-pushed the libcshims-android-swift-mode-t branch from b4a1227 to ffc4228 Compare February 14, 2018 21:22
As defined(__linux__) also matches, this never gets to the final else case.
@gonzalolarralde gonzalolarralde force-pushed the libcshims-android-swift-mode-t branch from ffc4228 to fb08fb8 Compare February 14, 2018 21:42
@compnerd
Copy link
Member

@swift-ci please test and merge

@swift-ci swift-ci merged commit 8045963 into swiftlang:master Feb 15, 2018
Sign up for free to 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.

3 participants