From 3ca72ad974169aa39f391774875a9cc2a77ee967 Mon Sep 17 00:00:00 2001
From: Cheng Shao <terrorjack@type.dance>
Date: Sun, 12 May 2024 19:15:45 +0000
Subject: [PATCH] rts: fix missing function prototypes in ClosureMacros.h

---
 rts/include/rts/storage/ClosureMacros.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/rts/include/rts/storage/ClosureMacros.h b/rts/include/rts/storage/ClosureMacros.h
index b28f0d893f6..2526dc91dae 100644
--- a/rts/include/rts/storage/ClosureMacros.h
+++ b/rts/include/rts/storage/ClosureMacros.h
@@ -145,6 +145,18 @@ EXTERN_INLINE StgHalfWord GET_TAG(const StgClosure *con)
    -------------------------------------------------------------------------- */
 
 #if defined(PROFILING)
+
+/*
+  These prototypes are in RtsFlags.h. We can't include RtsFlags.h here
+  because that's a private header, but we do need these prototypes to
+  be duplicated here, otherwise there will be some
+  -Wimplicit-function-declaration compilation errors. Especially when
+  GHC compiles out-of-tree cbits that rely on SET_HDR in RTS API.
+*/
+bool doingLDVProfiling(void);
+bool doingRetainerProfiling(void);
+bool doingErasProfiling(void);
+
 /*
   The following macro works for both retainer profiling and LDV profiling. For
  retainer profiling, we set 'trav' to 0, which is an invalid
-- 
GitLab