All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
features.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022 Gunar Schorcht
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
22 #ifndef SYS_FEATURES_H
23 #define SYS_FEATURES_H
24 
25 #ifndef DOXYGEN
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #include_next <sys/features.h>
32 
33 /*
34  * When using a GCC version with POSIX thread support enabled, as is the
35  * case with Espressif's precompiled toolchains, the `_POSIX_THREAD`
36  * definition has to be reverted to prevent the inclusion of newlib's
37  * POXIS header files in system headers to avoid compilation errors.
38  * The reason is that RIOT uses its own `pthread` implementation, but
39  * its type declarations are not fully compatible with those in
40  * `sys/_pthreadtypes.h`.
41  */
42 #undef _POSIX_THREADS
43 
44 /*
45  * To avoid type conflicts between the `pthread_rwlockattr_t` definition
46  * in RIOT's `pthread` implementation and newlibc's `sys/_pthreadtypes.h`,
47  * the macro `_POSIX_READER_WRITER_LOCKS` must be undefined.
48  */
49 #undef _POSIX_READER_WRITER_LOCKS
50 
51 #ifdef __cplusplus
52 }
53 #endif
54 
55 #endif /* DOXYGEN */
56 #endif /* SYS_FEATURES_H */