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 <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
Jérôme Duval
2021-06-21 12:31:53 +00:00
committed by Alex von Gluck IV
parent 325ab89b90
commit ddffdd2506
+14
View File
@@ -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 */