Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions source/MRMesh/MRUnitInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,13 @@ enum class InvLengthUnit

// All supported value types for `valueToString()`.
// Not using `__VA_OPT__(,)` here to support legacy MSVC preprocessor.
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#endif
#define DETAIL_MR_UNIT_VALUE_TYPES(X, ...) \
X(float ,__VA_ARGS__) X(double ,__VA_ARGS__) X(long double ,__VA_ARGS__) \
X(signed char ,__VA_ARGS__) X(unsigned char ,__VA_ARGS__) \
X(short ,__VA_ARGS__) X(unsigned short ,__VA_ARGS__) \
X(int ,__VA_ARGS__) X(unsigned int ,__VA_ARGS__) \
X(long ,__VA_ARGS__) X(unsigned long ,__VA_ARGS__) \
X(long long ,__VA_ARGS__) X(unsigned long long ,__VA_ARGS__)
#ifdef __clang__
#pragma clang diagnostic pop
#endif

// Whether `E` is one of the unit enums: NoUnit, LengthUnit, AngleUnit, ...
template <typename T>
Expand Down
26 changes: 19 additions & 7 deletions source/MRViewer/MRGLMacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,28 @@
#if !defined( NDEBUG ) && !defined( MR_GL_NO_LOGGING )
#include "MRPch/MRSpdlog.h"
#include "MRMesh/MRFinally.h"

// Not using `__VA_OPT__(,)` here to support legacy MSVC preprocessor.
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#endif

#define GL_EXEC( ... ) \
[&]() -> decltype(auto) \
{ \
MR_FINALLY{ \
( \
void(MR::detail::ScopeGuard([] \
{ \
auto error = glGetError();\
if ( error != 0 )\
spdlog::warn("GL error: {} In file: {} Line: {}", error , __FILE__ , __LINE__ );\
}; \
return __VA_ARGS__;\
}()
})) \
,##__VA_ARGS__\
)

#ifdef __clang__
#pragma clang diagnostic pop
#endif

#else
#define GL_EXEC( ... ) __VA_ARGS__
#endif
#endif
Loading