diff --git a/CMakeLists.txt b/CMakeLists.txt index efcee3b6..9743c848 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,7 @@ configure_file(${PROJECT_SOURCE_DIR}/libgo/common/cmake_config.h.in ${PROJECT_SO message("----------------------------------") if (UNIX) - set(CMAKE_CXX_FLAGS "-std=c++11 -D__const__= -fPIC -fno-strict-aliasing -Wall ${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "-std=c++11 -D__const__=__unused__ -fPIC -fno-strict-aliasing -Wall ${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS_DEBUG "-g") set(CMAKE_CXX_FLAGS_RELEASE "-g -O3 -DNDEBUG") diff --git a/libgo/coroutine.h b/libgo/coroutine.h index 03a14d4d..f97d91cd 100644 --- a/libgo/coroutine.h +++ b/libgo/coroutine.h @@ -1,5 +1,9 @@ #pragma once -#define __const__ + +#ifndef __const__ +#define __const__ __unused__ +#endif + #include "common/config.h" #include "common/pp.h" #include "common/syntax_helper.h" diff --git a/libgo/defer/defer.h b/libgo/defer/defer.h index ad3dc4a2..7b85987b 100644 --- a/libgo/defer/defer.h +++ b/libgo/defer/defer.h @@ -7,7 +7,7 @@ namespace co struct dismisser { virtual bool dismiss() = 0; - + virtual ~dismisser() = default; static dismisser*& GetLastDefer(); static void SetLastDefer(dismisser*); static void ClearLastDefer(dismisser*);