[PATCH] D144586: [PS4/PS5] Specify no <complex.h> or <threads.h>
Paul Robinson via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 23 07:09:44 PST 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG32d441bfb4f3: [PS4/PS5] Specify no <complex.h> or <threads.h> (authored by probinson).
Herald added a project: clang.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D144586/new/
https://reviews.llvm.org/D144586
Files:
clang/lib/Basic/Targets/OSTargets.h
clang/test/C/C11/n1460.c
Index: clang/test/C/C11/n1460.c
===================================================================
--- clang/test/C/C11/n1460.c
+++ clang/test/C/C11/n1460.c
@@ -7,9 +7,15 @@
// If we claim to not support the feature then we expect diagnostics when
// using that feature. Otherwise, we expect no diagnostics.
#ifdef __STDC_NO_COMPLEX__
- // We do not have any targets which do not support complex, so we don't
- // expect to get into this block.
- #error "it's unexpected that we don't support complex"
+ // PS4/PS5 set this to indicate no <complex.h> but still support the
+ // _Complex syntax.
+ #ifdef __SCE__
+ #define HAS_COMPLEX
+ #else
+ // We do not have any other targets which do not support complex, so we
+ // don't expect to get into this block.
+ #error "it's unexpected that we don't support complex"
+ #endif
float _Complex fc;
double _Complex dc;
long double _Complex ldc;
Index: clang/lib/Basic/Targets/OSTargets.h
===================================================================
--- clang/lib/Basic/Targets/OSTargets.h
+++ clang/lib/Basic/Targets/OSTargets.h
@@ -535,6 +535,8 @@
DefineStd(Builder, "unix", Opts);
Builder.defineMacro("__ELF__");
Builder.defineMacro("__SCE__");
+ Builder.defineMacro("__STDC_NO_COMPLEX__");
+ Builder.defineMacro("__STDC_NO_THREADS__");
}
public:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144586.499844.patch
Type: text/x-patch
Size: 1360 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230223/c37eda3e/attachment-0001.bin>
More information about the cfe-commits
mailing list