Skip to content

Commit 6b43425

Browse files
QuzarDCQuzarDC
authored andcommitted
spinlock: Restrict use to C only.
As these are static inline they aren't valid in c++. They should only be for internal use anyways, and are likely to be dropped soon. Perhaps we could also add a cpp version if they stay for the long term.
1 parent 372971c commit 6b43425

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

include/kos/spinlock.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
#define __KOS_SPINLOCK_H
2525

2626
#include <kos/cdefs.h>
27-
__BEGIN_DECLS
27+
28+
/* These can only be used in C */
29+
#if !defined(__cplusplus)
2830

2931
#include <stdatomic.h>
3032
#include <stdbool.h>
@@ -149,6 +151,6 @@ static inline void __spinlock_scoped_cleanup(spinlock_t **lock) {
149151
#define spinlock_lock_scoped(lock) \
150152
__spinlock_lock_scoped((lock), __LINE__)
151153

152-
__END_DECLS
154+
#endif /* !defined(__cplusplus) */
153155

154156
#endif /* __KOS_SPINLOCK_H */

0 commit comments

Comments
 (0)