Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Sources/_SwiftSyntaxCShims/include/Atomics.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
#include <stdbool.h>
#include <stdlib.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
_Atomic(bool) value;
} AtomicBool;
Expand Down Expand Up @@ -50,4 +54,8 @@ static inline void swiftsyntax_atomic_pointer_set(AtomicPointer *_Nonnull atomic
atomic->value = newValue;
}

#ifdef __cplusplus
}
#endif

#endif // SWIFTSYNTAX_ATOMICBOOL_H
8 changes: 8 additions & 0 deletions Sources/_SwiftSyntaxCShims/include/PlatformMutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

#include "_bridging.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct PlatformMutex {
void *opaque;
} PlatformMutex;
Expand All @@ -31,4 +35,8 @@ void swiftsyntax_platform_mutex_unlock(PlatformMutex m);
SWIFT_NAME_S("PlatformMutex.destroy(self:)")
void swiftsyntax_platform_mutex_destroy(PlatformMutex m);

#ifdef __cplusplus
}
#endif

#endif // SWIFTSYNTAX_PLATFORMMUTEX_H
8 changes: 8 additions & 0 deletions Sources/_SwiftSyntaxCShims/include/swiftsyntax_errno.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,17 @@

#include <errno.h>

#ifdef __cplusplus
extern "C" {
#endif

SWIFT_NAME_S("getter:swift_syntax_errno()")
static inline int swiftsyntax_errno(void) {
return errno;
}

#ifdef __cplusplus
}
#endif

#endif // SWIFTSYNTAX_ERRNO_H
8 changes: 8 additions & 0 deletions Sources/_SwiftSyntaxCShims/include/swiftsyntax_stdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

#include <stdio.h>

#ifdef __cplusplus
extern "C" {
#endif

SWIFT_NAME_S("getter:swift_syntax_stdout()")
static inline FILE *swiftsyntax_stdout(void) {
return stdout;
Expand All @@ -32,4 +36,8 @@ static inline FILE *swiftsyntax_stderr(void) {
return stderr;
}

#ifdef __cplusplus
}
#endif

#endif // SWIFTSYNTAX_STDIO_H