Skip to content

Commit 880cfce

Browse files
committed
disable _Atomic and __thread keywords when writing on JetBrains
1 parent 175ba36 commit 880cfce

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Include/pyport.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,22 @@
88
# error "Python's source code assumes C's unsigned char is an 8-bit type"
99
#endif
1010

11+
/*
12+
* Disable keywords and operators that are not recognized by CLion.
13+
*
14+
* This is only a temporary solution until CLion correctly supports them.
15+
*/
16+
#ifdef __JETBRAINS_IDE__
17+
/*
18+
* Prevents false positives in CLion's static analysis which incorrectly
19+
* detects _Atomic(size_t) and _Atomic(uintptr_t) as duplicated declarations
20+
* of size_t and uintptr_t respectively.
21+
*/
22+
#define _Atomic(x) x
23+
24+
/* Ignore C99 TLS extension '__thread' keyword. */
25+
#define __thread
26+
#endif
1127

1228
// Preprocessor check for a builtin preprocessor function. Always return 0
1329
// if __has_builtin() macro is not defined.

0 commit comments

Comments
 (0)