Skip to content

Commit

Permalink
Use _LIBCPP_VERSION macro instead of __clang (#531)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinTF committed Jan 4, 2022
1 parent 49dabf9 commit 1f45527
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
18 changes: 9 additions & 9 deletions src/util/Generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
#ifndef CPPCORO_GENERATOR_HPP_INCLUDED
#define CPPCORO_GENERATOR_HPP_INCLUDED

// coroutines are still experimental in clang, adapt the appropriate
// namespaces.
#ifdef __clang__
#include <exception>
#include <functional>
#include <iterator>
#include <type_traits>
#include <utility>

// coroutines are still experimental in clang libcpp,
// adapt the appropriate namespaces.
#ifdef _LIBCPP_VERSION
#include <experimental/coroutine>
namespace qlever_stdOrExp = std::experimental;
#else
#include <coroutine>
namespace qlever_stdOrExp = std;
#endif

#include <exception>
#include <functional>
#include <iterator>
#include <type_traits>
#include <utility>

namespace cppcoro {
template <typename T>
class generator;
Expand Down
9 changes: 5 additions & 4 deletions src/util/streamable_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@
#include <exception>
#include <sstream>

#include "./ostringstream.h"

// coroutines are still experimental in clang, adapt the appropriate namespaces.
#ifdef __clang__
// coroutines are still experimental in clang libcpp,
// adapt the appropriate namespaces.
#ifdef _LIBCPP_VERSION
#include <experimental/coroutine>
namespace qlever_stdOrExp = std::experimental;
#else
#include <coroutine>
namespace qlever_stdOrExp = std;
#endif

#include "./ostringstream.h"

namespace ad_utility::stream_generator {

/**
Expand Down

0 comments on commit 1f45527

Please sign in to comment.