From ddffdd25068a0fcbe09aeb55cb673f1f00ab78a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Tue, 15 Jun 2021 22:03:23 +0200 Subject: [PATCH] C11: define __STDC_NO_THREADS__ as threads.h is not provided Theorically we could define __STDC_NO_THREADS__ internally in GCC, but threads.h probably will be added in the future, and the compiler won't notice. Using this stdc-predef.h header and including it in GCC would solve this nicely, and saves us from hardcoding. The header can eventually be removed when obsolete. Change-Id: I29aa58686e3c45449dc63e02e5a9e13a960b9090 Reviewed-on: https://review.haiku-os.org/c/haiku/+/4097 Tested-by: Commit checker robot Reviewed-by: Adrien Destugues --- headers/posix/stdc-predef.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 headers/posix/stdc-predef.h diff --git a/headers/posix/stdc-predef.h b/headers/posix/stdc-predef.h new file mode 100644 index 0000000000..fc51da35d7 --- /dev/null +++ b/headers/posix/stdc-predef.h @@ -0,0 +1,14 @@ +/* + * Copyright 2021 Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ +#ifndef _STDC_PREDEF_H +#define _STDC_PREDEF_H + + +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +# define __STDC_NO_THREADS__ 1 +#endif + + +#endif /* _STDC_PREDEF_H */