From: Bartosz Golaszewski Date: Mon, 3 Feb 2020 10:24:03 +0000 (+0100) Subject: bindings: cxx: fix std namespace resolution X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=573f3a91ace8fbff9e1751c63e328319b41a9e27;p=qemu-gpiodev%2Flibgpiod.git bindings: cxx: fix std namespace resolution We try to always resolve symbols from std starting from the global namespace by using the '::' prefix but there are a couple places where this was missed. This patch makes the resolution consistent treewide. Signed-off-by: Bartosz Golaszewski --- diff --git a/bindings/cxx/gpiod.hpp b/bindings/cxx/gpiod.hpp index f5df18e..07f465f 100644 --- a/bindings/cxx/gpiod.hpp +++ b/bindings/cxx/gpiod.hpp @@ -660,7 +660,7 @@ public: * output direction requests. */ GPIOD_API void request(const line_request& config, - const std::vector default_vals = std::vector()) const; + const ::std::vector default_vals = ::std::vector()) const; /** * @brief Release all lines held by this object. @@ -690,7 +690,7 @@ public: * Only relevant for output direction requests. */ GPIOD_API void set_config(int direction, ::std::bitset<32> flags, - const ::std::vector values = std::vector()) const; + const ::std::vector values = ::std::vector()) const; /** * @brief Set configuration flags of all lines held by this object. diff --git a/bindings/cxx/line_bulk.cpp b/bindings/cxx/line_bulk.cpp index b8f5eb7..e77baa2 100644 --- a/bindings/cxx/line_bulk.cpp +++ b/bindings/cxx/line_bulk.cpp @@ -68,7 +68,7 @@ void line_bulk::append(const line& new_line) throw ::std::logic_error("maximum number of lines reached"); if (this->_m_bulk.size() >= 1 && this->_m_bulk.begin()->get_chip() != new_line.get_chip()) - throw std::logic_error("line_bulk cannot hold GPIO lines from different chips"); + throw ::std::logic_error("line_bulk cannot hold GPIO lines from different chips"); this->_m_bulk.push_back(new_line); } @@ -98,7 +98,7 @@ void line_bulk::clear(void) this->_m_bulk.clear(); } -void line_bulk::request(const line_request& config, const std::vector default_vals) const +void line_bulk::request(const line_request& config, const ::std::vector default_vals) const { this->throw_if_empty(); @@ -345,7 +345,7 @@ line_bulk::iterator line_bulk::end(void) noexcept void line_bulk::throw_if_empty(void) const { if (this->_m_bulk.empty()) - throw std::logic_error("line_bulk not holding any GPIO lines"); + throw ::std::logic_error("line_bulk not holding any GPIO lines"); } void line_bulk::to_line_bulk(::gpiod_line_bulk *bulk) const diff --git a/bindings/cxx/tests/gpio-mockup.cpp b/bindings/cxx/tests/gpio-mockup.cpp index 64333f7..0005d3f 100644 --- a/bindings/cxx/tests/gpio-mockup.cpp +++ b/bindings/cxx/tests/gpio-mockup.cpp @@ -56,7 +56,7 @@ void mockup::remove(void) "unable to remove gpio-mockup module"); } -std::string mockup::chip_name(unsigned int idx) const +::std::string mockup::chip_name(unsigned int idx) const { const char *name = ::gpio_mockup_chip_name(this->_m_mockup, idx); if (!name) @@ -66,7 +66,7 @@ std::string mockup::chip_name(unsigned int idx) const return ::std::string(name); } -std::string mockup::chip_path(unsigned int idx) const +::std::string mockup::chip_path(unsigned int idx) const { const char *path = ::gpio_mockup_chip_path(this->_m_mockup, idx); if (!path)