bus: fix message conflicting definitions
If `sdbusplus/message.hpp` is included before `sdbusplus/bus.hpp`, we
end up with a compile failure as follows:
```
../subprojects/sdbusplus/include/sdbusplus/bus.hpp:660:13: error: no declaration matches ‘auto sdbusplus::message::message::get_bus() const’
660 | inline auto message_t::get_bus() const
| ^~~~~~~~~
In file included from ../utils/dbus.hpp:3,
from ../cmd/power-state.cpp:1:
../subprojects/sdbusplus/include/sdbusplus/message.hpp:188:17: note: candidate is: ‘auto sdbusplus::message::message::get_bus() const’
188 | inline auto get_bus() const;
| ^~~~~~~
../subprojects/sdbusplus/include/sdbusplus/message.hpp:70:7: note: ‘class sdbusplus::message::message’ defined here
70 | class message : private sdbusplus::slot::details::slot_friend
| ^~~~~~~
```
Fix this by being more explicit about the types rather than relying on
auto in a forward declaration.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I627a7901933d73aeec87f20b65605e4b04951758
diff --git a/include/sdbusplus/bus.hpp b/include/sdbusplus/bus.hpp
index ab9ba04..7e834c0 100644
--- a/include/sdbusplus/bus.hpp
+++ b/include/sdbusplus/bus.hpp
@@ -657,7 +657,7 @@
*
* @return The dbus bus.
*/
-inline auto message_t::get_bus() const
+inline bus_t message_t::get_bus() const
{
sd_bus* b = nullptr;
b = _intf->sd_bus_message_get_bus(_msg.get());
diff --git a/include/sdbusplus/message.hpp b/include/sdbusplus/message.hpp
index 54312fa..93e0923 100644
--- a/include/sdbusplus/message.hpp
+++ b/include/sdbusplus/message.hpp
@@ -185,7 +185,7 @@
/** @brief Get the dbus bus from the message. */
// Forward declare.
- auto get_bus() const;
+ bus::bus get_bus() const;
/** @brief Get the signature of a message.
*