0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-27 00:31:02 +08:00

Gcc compile fix

This commit is contained in:
Sergey Yagovtsev 2016-08-31 21:51:00 +03:00
parent cbcfe4c184
commit d8f44ba559
2 changed files with 7 additions and 3 deletions

View File

@ -27,7 +27,7 @@ include_directories(
)
if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -Wno-reorder -pedantic -O3" )
else()
add_definitions(

View File

@ -99,7 +99,11 @@ Name of the block automatically created with function name.
\ingroup profiler
*/
#define EASY_FUNCTION(...) EASY_BLOCK(__func__ , ## __VA_ARGS__)
#define EASY_FUNCTION(...)\
static const ::profiler::StaticBlockDescriptor EASY_UNIQUE_DESC(__LINE__)(__func__, __FILE__, __LINE__,\
::profiler::BLOCK_TYPE_BLOCK , ## __VA_ARGS__);\
::profiler::Block EASY_UNIQUE_BLOCK(__LINE__)(::profiler::BLOCK_TYPE_BLOCK, EASY_UNIQUE_DESC(__LINE__).id(), "");\
::profiler::beginBlock(EASY_UNIQUE_BLOCK(__LINE__)); // this is to avoid compiler warning about unused variable
/** Macro of completion of last nearest open block.