Skip to content

Commit fe6b8aa

Browse files
authored
Merge pull request swiftlang#574 from swiftwasm/main
[pull] swiftwasm from main
2 parents fd66867 + f3f3a73 commit fe6b8aa

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

CoreFoundation/Base.subproj/CFBase.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@
6666

6767
#if defined(__GNUC__) || TARGET_OS_WIN32
6868
#include <stdint.h>
69-
#include <stdbool.h>
7069
#endif
7170

71+
#include <stdbool.h>
72+
7273
#if __BLOCKS__ && (TARGET_OS_OSX || TARGET_OS_IPHONE)
7374
#include <Block.h>
7475
#endif
@@ -80,7 +81,7 @@
8081
#if !defined(__MACTYPES__)
8182
#if !defined(_OS_OSTYPES_H)
8283
#if DEPLOYMENT_RUNTIME_SWIFT
83-
typedef _Bool Boolean;
84+
typedef bool Boolean;
8485
#else
8586
typedef unsigned char Boolean;
8687
#endif

CoreFoundation/Base.subproj/CFOverflow.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
#if __has_include(<os/overflow.h>)
1616
#include <os/overflow.h>
1717
#else
18-
static _Bool __os_warn_unused(_Bool x) __attribute__((__warn_unused_result__));
19-
static _Bool __os_warn_unused(_Bool x) { return x; }
18+
static bool __os_warn_unused(bool x) __attribute__((__warn_unused_result__));
19+
static bool __os_warn_unused(bool x) { return x; }
2020

2121
#if __has_builtin(__builtin_add_overflow) && \
2222
__has_builtin(__builtin_sub_overflow) && \

CoreFoundation/Base.subproj/ForFoundationOnly.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ typedef CF_ENUM(CFOptionFlags, _CFAllocatorHint) {
8484
#define NSISARGTYPE id _Nullable
8585
#else
8686
#define NSISARGTYPE void * _Nullable
87-
#define BOOL _Bool
87+
#define BOOL bool
8888
#endif
8989

9090
CF_EXPORT BOOL _NSIsNSArray(NSISARGTYPE arg);

CoreFoundation/Base.subproj/ForSwiftFoundationOnly.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -484,10 +484,10 @@ CF_CROSS_PLATFORM_EXPORT void __CFURLComponentsDeallocate(CFTypeRef cf);
484484
typedef struct {
485485
void *_Nonnull memory;
486486
size_t capacity;
487-
_Bool onStack;
487+
bool onStack;
488488
} _ConditionalAllocationBuffer;
489489

490-
static inline _Bool _resizeConditionalAllocationBuffer(_ConditionalAllocationBuffer *_Nonnull buffer, size_t amt) {
490+
static inline bool _resizeConditionalAllocationBuffer(_ConditionalAllocationBuffer *_Nonnull buffer, size_t amt) {
491491
#if TARGET_OS_MAC
492492
size_t amount = malloc_good_size(amt);
493493
#else
@@ -511,7 +511,7 @@ static inline _Bool _resizeConditionalAllocationBuffer(_ConditionalAllocationBuf
511511
}
512512

513513
#if TARGET_OS_WASI
514-
static inline _Bool _withStackOrHeapBuffer(size_t amount, void (__attribute__((noescape)) ^ _Nonnull applier)(_ConditionalAllocationBuffer *_Nonnull)) {
514+
static inline bool _withStackOrHeapBuffer(size_t amount, void (__attribute__((noescape)) ^ _Nonnull applier)(_ConditionalAllocationBuffer *_Nonnull)) {
515515
_ConditionalAllocationBuffer buffer;
516516
buffer.capacity = amount;
517517
buffer.onStack = false;
@@ -522,7 +522,7 @@ static inline _Bool _withStackOrHeapBuffer(size_t amount, void (__attribute__((n
522522
return true;
523523
}
524524
#else
525-
static inline _Bool _withStackOrHeapBuffer(size_t amount, void (__attribute__((noescape)) ^ _Nonnull applier)(_ConditionalAllocationBuffer *_Nonnull)) {
525+
static inline bool _withStackOrHeapBuffer(size_t amount, void (__attribute__((noescape)) ^ _Nonnull applier)(_ConditionalAllocationBuffer *_Nonnull)) {
526526
_ConditionalAllocationBuffer buffer;
527527
#if TARGET_OS_MAC
528528
buffer.capacity = malloc_good_size(amount);
@@ -540,7 +540,7 @@ static inline _Bool _withStackOrHeapBuffer(size_t amount, void (__attribute__((n
540540
}
541541
#endif
542542

543-
static inline _Bool _withStackOrHeapBufferWithResultInArguments(size_t amount, void (__attribute__((noescape)) ^ _Nonnull applier)(void *_Nonnull memory, size_t capacity, _Bool onStack)) {
543+
static inline bool _withStackOrHeapBufferWithResultInArguments(size_t amount, void (__attribute__((noescape)) ^ _Nonnull applier)(void *_Nonnull memory, size_t capacity, bool onStack)) {
544544
return _withStackOrHeapBuffer(amount, ^(_ConditionalAllocationBuffer *buffer) {
545545
applier(buffer->memory, buffer->capacity, buffer->onStack);
546546
});
@@ -647,13 +647,13 @@ _stat_with_btime(const char *filename, struct stat *buffer, struct timespec *bti
647647

648648
static unsigned int const _CF_renameat2_RENAME_EXCHANGE = 1 << 1;
649649
#ifdef SYS_renameat2
650-
static _Bool const _CFHasRenameat2 = 1;
650+
static bool const _CFHasRenameat2 = 1;
651651
static inline int _CF_renameat2(int olddirfd, const char *_Nonnull oldpath,
652652
int newdirfd, const char *_Nonnull newpath, unsigned int flags) {
653653
return syscall(SYS_renameat2, olddirfd, oldpath, newdirfd, newpath, flags);
654654
}
655655
#else
656-
static _Bool const _CFHasRenameat2 = 0;
656+
static bool const _CFHasRenameat2 = 0;
657657
static inline int _CF_renameat2(int olddirfd, const char *_Nonnull oldpath,
658658
int newdirfd, const char *_Nonnull newpath, unsigned int flags) {
659659
return ENOSYS;

CoreFoundation/PlugIn.subproj/CFBundle_Grok.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
// Windows isspace implementation limits the input chars to < 256 in the ASCII range. It will
4848
// assert in debug builds. This is annoying. We merrily grok chars > 256.
49-
static inline _Bool _CF_isspace(int c) {
49+
static inline bool _CF_isspace(int c) {
5050
return (c == ' ' || c == '\t' || c == '\n' || c == '\r'|| c == '\v' || c == '\f');
5151
}
5252
#define isspace _CF_isspace

Darwin/shims/FoundationOverlayShims.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
typedef struct {
3838
void *_Nonnull memory;
3939
size_t capacity;
40-
_Bool onStack;
40+
bool onStack;
4141
} _ConditionalAllocationBuffer;
4242

43-
static inline _Bool _resizeConditionalAllocationBuffer(_ConditionalAllocationBuffer *_Nonnull buffer, size_t amt) {
43+
static inline bool _resizeConditionalAllocationBuffer(_ConditionalAllocationBuffer *_Nonnull buffer, size_t amt) {
4444
size_t amount = malloc_good_size(amt);
4545
if (amount <= buffer->capacity) { return true; }
4646
void *newMemory;
@@ -59,7 +59,7 @@ static inline _Bool _resizeConditionalAllocationBuffer(_ConditionalAllocationBuf
5959
return true;
6060
}
6161

62-
static inline _Bool _withStackOrHeapBuffer(size_t amount, void (__attribute__((noescape)) ^ _Nonnull applier)(_ConditionalAllocationBuffer *_Nonnull)) {
62+
static inline bool _withStackOrHeapBuffer(size_t amount, void (__attribute__((noescape)) ^ _Nonnull applier)(_ConditionalAllocationBuffer *_Nonnull)) {
6363
_ConditionalAllocationBuffer buffer;
6464
buffer.capacity = malloc_good_size(amount);
6565
buffer.onStack = (pthread_main_np() != 0 ? buffer.capacity < 2048 : buffer.capacity < 512);

0 commit comments

Comments
 (0)