summaryrefslogtreecommitdiffstats
path: root/cpukit/include/machine/_kernel_types.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2023-03-13 13:33:13 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2023-03-14 08:00:11 +0100
commit2859e422b33f3169e919c247ded32049a09cbb6f (patch)
tree8d2a9184e5a21cb8b2fa9eedcae2fb657e64149c /cpukit/include/machine/_kernel_types.h
parentvalidation: Derive names from item UIDs (diff)
downloadrtems-2859e422b33f3169e919c247ded32049a09cbb6f.tar.bz2
Provide kernel space items only if needed
The kernel space parts of standard system header files were protected against misuse by a preprocessor error directive. This approach does not work well with tools such as Doxygen. Provide the kernel space items only if the required defines are present.
Diffstat (limited to 'cpukit/include/machine/_kernel_types.h')
-rw-r--r--cpukit/include/machine/_kernel_types.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/cpukit/include/machine/_kernel_types.h b/cpukit/include/machine/_kernel_types.h
index 98f0366b64..7f70964e2d 100644
--- a/cpukit/include/machine/_kernel_types.h
+++ b/cpukit/include/machine/_kernel_types.h
@@ -32,9 +32,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#if !defined(_SYS_TYPES_H) || !defined(_KERNEL)
-#error "must be included via <sys/types.h> in kernel space"
-#endif
+#if defined(_SYS_TYPES_H) && defined(_KERNEL)
#include <stdbool.h>
@@ -42,3 +40,7 @@ typedef int boolean_t;
typedef struct device *device_t;
typedef char vm_memattr_t;
typedef struct vm_page *vm_page_t;
+
+#else /* !_SYS_TYPES_H || !_KERNEL */
+#error "must be included via <sys/types.h> in kernel space"
+#endif /* _SYS_TYPES_H && _KERNEL */