Skip to content

Commit

Permalink
iox-eclipse-iceoryx#33 removed some windows macros
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Eltzschig <christian.eltzschig2@de.bosch.com>
  • Loading branch information
elfenpiff committed Feb 5, 2020
1 parent e337c13 commit 6641146
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
#include <cstdint>
#include <limits>

// this header must always be the last one, otherwise windows macros
// are kicking in and nothing compiles
#include "iceoryx_utils/platform/platform-correction.hpp"

namespace iox
{
namespace mepoo
Expand Down Expand Up @@ -77,4 +81,3 @@ class MemoryManager

} // namespace mepoo
} // namespace iox

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "iceoryx_utils/internal/relocatable_pointer/relative_ptr.hpp"
#include "iceoryx_utils/posix_wrapper/semaphore.hpp"

#include "iceoryx_utils/platform/platform-correction.hpp"

namespace iox
{
namespace popo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct SenderPortData : public BasePortData
mutable concurrent::TACO<Throughput, ThreadContext> m_throughputExchange{
concurrent::TACOMode::DenyDataFromSameContext};

iox::relative_ptr<mepoo::MemoryManager> m_memoryMgr;
relative_ptr<mepoo::MemoryManager> m_memoryMgr;
mepoo::SharedChunk m_lastChunk{nullptr};
};

Expand Down
6 changes: 3 additions & 3 deletions iceoryx_utils/include/iceoryx_utils/cxx/optional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class optional
/// @param[in] value value to assign to the underlying optional value
/// @return reference to the current optional
template <typename U = T>
typename std::enable_if<!std::is_same<U, optional<T>&>::value, optional>::type& operator=(U&& value) noexcept;
typename ::std::enable_if<!::std::is_same<U, optional<T>&>::value, optional>::type& operator=(U&& value) noexcept;

/// @brief Returns a pointer to the underlying value. If the optional has no
/// value the behavior is undefined. You need to verify that the
Expand Down Expand Up @@ -182,7 +182,7 @@ class optional
/// value the behavior is undefined. You need to verify that the
/// optional has a value by calling has_value() before using it.
/// @return const reference to the underlying type
const T& value() const & noexcept;
const T& value() const& noexcept;

/// @brief Returns a rvalue reference to the underlying value. If the optional has no
/// value the behavior is undefined. You need to verify that the
Expand All @@ -194,7 +194,7 @@ class optional
/// value the behavior is undefined. You need to verify that the
/// optional has a value by calling has_value() before using it.
/// @return const rvalue reference to the underlying type
const T&& value() const && noexcept;
const T&& value() const&& noexcept;

/// @brief If the optional contains a value a copy of that value is returned,
/// otherwise the default_value is returned.
Expand Down
6 changes: 3 additions & 3 deletions iceoryx_utils/include/iceoryx_utils/internal/cxx/optional.inl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ inline optional<T>::~optional() noexcept

template <typename T>
template <typename U>
inline typename std::enable_if<!std::is_same<U, optional<T>&>::value, optional<T>>::type& optional<T>::
inline typename ::std::enable_if<!::std::is_same<U, optional<T>&>::value, optional<T>>::type& optional<T>::
operator=(U&& newValue) noexcept
{
if (m_hasValue)
Expand Down Expand Up @@ -213,7 +213,7 @@ template <typename T>
}

template <typename T>
inline const T& optional<T>::value() const & noexcept
inline const T& optional<T>::value() const& noexcept
{
auto data = static_cast<const T*>(static_cast<const void*>(m_data));
return *data;
Expand All @@ -227,7 +227,7 @@ template <typename T>
}

template <typename T>
inline const T&& optional<T>::value() const && noexcept
inline const T&& optional<T>::value() const&& noexcept
{
auto data = static_cast<const T*>(static_cast<const void*>(m_data));
return std::move(*data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once
// !NO PRAGMA ONE HERE! we want that these macros are always executed and
// not just once, otherwise the windows macros are kicking in and nothing
// compiles
//#pragma once

#ifndef __PRETTY_FUNCTION__
#define __PRETTY_FUNCTION__ __FUNCSIG__
#undef CreateMutexA
#endif

#undef CreateMutex
#undef max
#undef min
#undef ERROR

0 comments on commit 6641146

Please sign in to comment.