optick
optick copied to clipboard
can't compile on linux using g++ 8.3.0 and -std=c++11
../../../optick/src/optick.h:821:193: error: expected primary-expression before ‘)’ token
if (OPTICK_CONCAT(autogen_description_, LINE) == nullptr) OPTICK_CONCAT(autogen_description_, LINE) = ::Optick::CreateDescription(OPTICK_FUNC, FILE, LINE, ##VA_ARGS);
^
../../Source/Callbacks.h:1012:3: note: in expansion of macro ‘OPTICK_EVENT’
OPTICK_EVENT();
^~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
I now worked around this by passing a string to OPTICK_EVENT(), as well as other OPTICK_ ... macros.
I'm facing the similar issue with Clang 15.0.6 and C++20 on Ubuntu 22.10
src/Arc/Utils/StringUtils.h:32:4: error: expected unqualified-id
ARC_PROFILE_SCOPE()
^
src/Arc/Debug/Profiler.h:248:40: note: expanded from macro 'ARC_PROFILE_SCOPE'
#define ARC_PROFILE_SCOPE(...) ::OPTICK_EVENT(__VA_ARGS__);
^
/home/mohit/dev/ArcGameEngine/Arc/vendor/optick/src/optick.h:836:28: note: expanded from macro 'OPTICK_EVENT'
#define OPTICK_EVENT(...) static ::Optick::EventDescription* OPTICK_CONCAT(autogen_description_, __LINE__) = nullptr; \
^
In file included from src/Arc/Core/Application.cpp:6:
In file included from src/Arc/Scripting/ScriptEngine.h:4:
src/Arc/Utils/StringUtils.h:32:4: error: use of undeclared identifier 'autogen_description_32'
src/Arc/Debug/Profiler.h:248:40: note: expanded from macro 'ARC_PROFILE_SCOPE'
#define ARC_PROFILE_SCOPE(...) ::OPTICK_EVENT(__VA_ARGS__);
^
/home/mohit/dev/ArcGameEngine/Arc/vendor/optick/src/optick.h:837:13: note: expanded from macro 'OPTICK_EVENT'
if (OPTICK_CONCAT(autogen_description_, __LINE__) == nullptr) OPTICK_CONCAT(autogen_description_, __LINE__) = ::Optick::CreateDescription(OPTICK_FUNC, __FILE__, __LINE__, ##__VA_ARGS__); \
^
/home/mohit/dev/ArcGameEngine/Arc/vendor/optick/src/optick.h:86:29: note: expanded from macro 'OPTICK_CONCAT'
#define OPTICK_CONCAT(x, y) OPTICK_CONCAT_IMPL(x, y)
^
/home/mohit/dev/ArcGameEngine/Arc/vendor/optick/src/optick.h:85:34: note: expanded from macro 'OPTICK_CONCAT_IMPL'
#define OPTICK_CONCAT_IMPL(x, y) x##y
^
<scratch space>:11:1: note: expanded from here
autogen_description_32