diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-09-01 18:18:15 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-10-09 08:42:31 -0400 |
commit | accdb24a086b80fe74776246aa33bce5a920e3c8 (patch) | |
tree | 1204e3b93332d6f54d2b5f71cc2794bdc9bd4a2d /rts/RtsUtils.c | |
parent | fd984d68e5ec4b04bc79395c099434e653eb1060 (diff) | |
download | haskell-accdb24a086b80fe74776246aa33bce5a920e3c8.tar.gz |
Expose RTS-only ways (#18651)
Some RTS ways are exposed via settings (ghcThreaded, ghcDebugged) but
not all. It's simpler if the RTS exposes them all itself.
Diffstat (limited to 'rts/RtsUtils.c')
-rw-r--r-- | rts/RtsUtils.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/rts/RtsUtils.c b/rts/RtsUtils.c index e88babcd08..ca01bdb6e0 100644 --- a/rts/RtsUtils.c +++ b/rts/RtsUtils.c @@ -363,6 +363,39 @@ int rts_isDynamic(void) #endif } +// Provides a way for Haskell programs to tell whether they're +// linked with the threaded runtime or not. +int rts_isThreaded(void) +{ +#if defined(THREADED_RTS) + return 1; +#else + return 0; +#endif +} + +// Provides a way for Haskell programs to tell whether they're +// linked with the debug runtime or not. +int rts_isDebugged(void) +{ +#if defined(DEBUG) + return 1; +#else + return 0; +#endif +} + +// Provides a way for Haskell programs to tell whether they're +// linked with the tracing runtime or not. +int rts_isTracing(void) +{ +#if defined(TRACING) + return 1; +#else + return 0; +#endif +} + // Used for detecting a non-empty FPU stack on x86 (see #4914) void checkFPUStack(void) { |