[commit: ghc] master: Remove redundant include of Rts.h in EventLogWriter.h (a24ab44)
git at git.haskell.org
git at git.haskell.org
Sat Dec 8 05:05:10 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/a24ab444c1b2242a47e4413de6b8e610acc56b2b/ghc
>---------------------------------------------------------------
commit a24ab444c1b2242a47e4413de6b8e610acc56b2b
Author: Zejun Wu <watashi at fb.com>
Date: Fri Dec 7 23:21:00 2018 -0500
Remove redundant include of Rts.h in EventLogWriter.h
`EventLogWriter.h` doesn't use anything from `Rts.h`, the include is
redundant. This include is ignored when we include
```
Rts.h -> RtsAPI.h -> rts/EventLogWriter.h -> Rts.h
```
but can can cause problem when we include `RtsApi.h` directly with
errors like
```
In file included from /usr/lib/ghc-8.6.2/include/RtsAPI.h:20:
In file included from
/usr/lib/ghc-8.6.2/include/rts/EventLogWriter.h:14:
In file included from /usr/lib/ghc-8.6.2/include/Rts.h:185:
/usr/lib/ghc-8.6.2/include/rts/storage/GC.h:187:29: error: unknown type
name 'Capability'
StgPtr allocate ( Capability *cap, W_ n );
```
Test Plan: ./validate
Reviewers: simonmar, bgamari, afarmer, erikd, alexbiehl
Reviewed By: bgamari, alexbiehl
Subscribers: rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5395
>---------------------------------------------------------------
a24ab444c1b2242a47e4413de6b8e610acc56b2b
includes/rts/EventLogWriter.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/includes/rts/EventLogWriter.h b/includes/rts/EventLogWriter.h
index 829b0f2..347ff5b 100644
--- a/includes/rts/EventLogWriter.h
+++ b/includes/rts/EventLogWriter.h
@@ -4,6 +4,11 @@
*
* Support for fast binary event logging.
*
+ * Do not #include this file directly: #include "Rts.h" instead.
+ *
+ * To understand the structure of the RTS headers, see the wiki:
+ * http://ghc.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
+ *
* ---------------------------------------------------------------------------*/
#pragma once
@@ -11,8 +16,6 @@
#include <stddef.h>
#include <stdbool.h>
-#include "Rts.h"
-
/*
* Abstraction for writing eventlog data.
*/
More information about the ghc-commits
mailing list