Skip to content

Commit

Permalink
测试新版本gcc对协程的支持程度
Browse files Browse the repository at this point in the history
  • Loading branch information
tearshark committed Jul 31, 2020
1 parent ec2dbb9 commit cbbbd9f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions librf/src/config.h
Expand Up @@ -2,9 +2,9 @@

#ifndef RESUMEF_INLINE_STATE
#if defined(__clang__) || defined(_MSC_VER)
#define RESUMEF_INLINE_STATE 1
/* #undef RESUMEF_INLINE_STATE */
#else
#define RESUMEF_INLINE_STATE 1
/* #undef RESUMEF_INLINE_STATE */
#endif //defined(__clang__) || defined(_MSC_VER)
#endif //RESUMEF_INLINE_STATE

Expand All @@ -14,9 +14,9 @@

#ifndef RESUMEF_ENABLE_CONCEPT
#ifdef __cpp_lib_concepts
/* #undef RESUMEF_ENABLE_CONCEPT */
#define RESUMEF_ENABLE_CONCEPT 1
#else
/* #undef RESUMEF_ENABLE_CONCEPT */
#define RESUMEF_ENABLE_CONCEPT 1
#endif //#ifdef __cpp_lib_concepts
#endif //#ifndef RESUMEF_ENABLE_CONCEPT

Expand Down
2 changes: 1 addition & 1 deletion tutorial/gcc_bugs.cpp
Expand Up @@ -10,7 +10,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#include "librf.h"
using namespace resumef;

#define GCC_FIX_BUGS 0
#define GCC_FIX_BUGS 1

static future_t<> gcc_bugs_if_await(event_t e)
{
Expand Down
4 changes: 4 additions & 0 deletions tutorial/test_async_when_all.cpp
Expand Up @@ -9,6 +9,7 @@

using namespace resumef;

#if !defined(__GNUC__)
void test_when_any()
{
using namespace std::chrono;
Expand Down Expand Up @@ -218,9 +219,11 @@ void test_when_select()

this_scheduler()->run_until_notask();
}
#endif

void resumable_main_when_all()
{
#if !defined(__GNUC__)
srand((uint32_t)time(nullptr));

test_when_any();
Expand All @@ -234,5 +237,6 @@ void resumable_main_when_all()

for (int i = 0; i < 10; ++i)
test_when_select();
#endif
}

0 comments on commit cbbbd9f

Please sign in to comment.