forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SwiftShims: don't redeclare libc functions
Clang importer thinks that SwiftShims is the primary module where they live, and this confuses code completion. rdar://22488333 Swift SVN r32218
- Loading branch information
Showing
20 changed files
with
161 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
//===--- LibcShims.h - Access to POSIX for Swift's core stdlib -----------===// | ||
// | ||
// This source file is part of the Swift.org open source project | ||
// | ||
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors | ||
// Licensed under Apache License v2.0 with Runtime Library Exception | ||
// | ||
// See http://swift.org/LICENSE.txt for license information | ||
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Using the Darwin (or Glibc) module in the core stdlib would create a | ||
// circular dependency, so instead we import these declarations as part of | ||
// SwiftShims. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef SWIFT_STDLIB_SHIMS_LIBCSHIMS_H | ||
#define SWIFT_STDLIB_SHIMS_LIBCSHIMS_H | ||
|
||
#include "SwiftStdint.h" | ||
#include "SwiftStddef.h" | ||
|
||
#ifdef __cplusplus | ||
namespace swift { extern "C" { | ||
#endif | ||
|
||
// This declaration is not universally correct. We verify its correctness for | ||
// the current platform in the runtime code. | ||
typedef long int __swift_ssize_t; | ||
|
||
// General utilities <stdlib.h> | ||
// Memory management functions | ||
void _swift_stdlib_free(void *ptr); | ||
|
||
// Input/output <stdio.h> | ||
int _swift_stdlib_putchar(int c); | ||
|
||
// String handling <string.h> | ||
__swift_size_t _swift_stdlib_strlen(const char *s); | ||
int _swift_stdlib_memcmp(const void *s1, const void *s2, __swift_size_t n); | ||
|
||
// <unistd.h> | ||
__swift_ssize_t _swift_stdlib_read(int fd, void *buf, __swift_size_t nbyte); | ||
__swift_ssize_t _swift_stdlib_write(int fd, const void *buf, | ||
__swift_size_t nbyte); | ||
int _swift_stdlib_close(int fd); | ||
|
||
// Non-standard extensions | ||
__swift_size_t _swift_stdlib_malloc_size(const void *ptr); | ||
__swift_uint32_t _swift_stdlib_arc4random(void); | ||
__swift_uint32_t _swift_stdlib_arc4random_uniform(__swift_uint32_t upper_bound); | ||
|
||
#ifdef __cplusplus | ||
}} // extern "C", namespace swift | ||
#endif | ||
|
||
#endif // SWIFT_STDLIB_SHIMS_LIBCSHIMS_H | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.