]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/MgrCap.h: avoid forward declare CephContext in different ways
authorKefu Chai <kchai@redhat.com>
Mon, 2 Mar 2020 12:45:03 +0000 (20:45 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 2 Mar 2020 13:28:30 +0000 (21:28 +0800)
this addresses the FTBFS like
```
home/jenkins/workspace/ceph-master/src/mgr/MgrCap.h:12:1: error: declaration conflicts with target of using declaration already in scope
class CephContext;
^
/home/jenkins/workspace/ceph-master/src/include/common_fwd.h:10:9: note: target of using declaration
  class CephContext;
        ^
/home/jenkins/workspace/ceph-master/src/include/common_fwd.h:22:24: note: using declaration
using TOPNSPC::common::CephContext;
                       ^
In file included from /home/jenkins/workspace/ceph-master/src/mgr/MgrCap.cc:24:
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mgr/MgrCap.h

index 3482ff21eed1f9c8589dda9718afc4c151c2eb4c..f7a8bd5f8e6971355b1bbc58f4616aab59a2fdfb 100644 (file)
@@ -4,13 +4,12 @@
 #ifndef CEPH_MGRCAP_H
 #define CEPH_MGRCAP_H
 
-#include <ostream>
+#include <iosfwd>
 
+#include "include/common_fwd.h"
 #include "include/types.h"
 #include "common/entity_name.h"
 
-class CephContext;
-
 static const __u8 MGR_CAP_R     = (1 << 1);      // read
 static const __u8 MGR_CAP_W     = (1 << 2);      // write
 static const __u8 MGR_CAP_X     = (1 << 3);      // execute