Skip to content

Various cleanups to definitions in the runtime #7490

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
merged 5 commits into from
Feb 21, 2017
Merged

Various cleanups to definitions in the runtime #7490

merged 5 commits into from
Feb 21, 2017

Conversation

hughbe
Copy link
Contributor

@hughbe hughbe commented Feb 15, 2017

@gparker42

Commit 1:

  • Only defines SWIFT_USE_SWIFTCALL if we actually can use SWIFTCALL.
  • Also clean up now redundant s390x check

Commit 2:

  • Don't use these attributes if we don't have a compiler that supports them
  • This increases the portability of the shims, and helps resolve some Visual Studio contribution experience nits

Commit 3:

  • Don't bother working around Darwin module being pulled in by stdint.h on Windows, for obvious reasons

@@ -21,6 +21,18 @@
// Clang has been defining __INTxx_TYPE__ macros for a long time.
// __UINTxx_TYPE__ are defined only since Clang 3.5.

#if defined(_WIN32)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is _WIN32 the right check here? I was expecting a check for clang versus MSVC.

Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively, if the __INT_TYPE__ versions are a Darwin-specific workaround then they should be behind an affirmative check for Darwin. Then everyone else defaults to the cleaner stdint.h form.

#endif

#if !defined(__has_attribute)
#define __has_attribute(x) 0
Copy link
Contributor Author

@hughbe hughbe Feb 18, 2017

Choose a reason for hiding this comment

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

BTW, we have to define these here, as these are installed headers - we don't want to rely on external LLVM files here.

@hughbe
Copy link
Contributor Author

hughbe commented Feb 20, 2017

Here is the very odd Linux error..

/usr/include/x86_64-linux-gnu/sys/types.h:146:10: error: 'stddef.h' file not found
#include <stddef.h>
         ^
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "AssertionReporting.h"

Looks like a bug?
http://askubuntu.com/questions/390805/clang-error-stddef-h-file-not-found
https://bugs.launchpad.net/ubuntu/+source/llvm-defaults/+bug/1242300
https://bugs.launchpad.net/ubuntu/+source/llvm-defaults/+bug/1198123
http://stackoverflow.com/questions/20587228/clang-error-stddef-file-not-found
android/ndk#215

@hughbe
Copy link
Contributor Author

hughbe commented Feb 20, 2017

@swift-ci please smoke test@swift-ci please smoke test

@gparker42
Copy link
Contributor

Looks good.

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