Skip to content

Deprecate Viewport's line draw methods#278

Merged
oitel merged 9 commits intomasterfrom
deprecate_viewport_lines
Jul 15, 2022
Merged

Deprecate Viewport's line draw methods#278
oitel merged 9 commits intomasterfrom
deprecate_viewport_lines

Conversation

@oitel
Copy link
Contributor

@oitel oitel commented Jul 15, 2022

No description provided.

@oitel oitel requested review from Fedr and Grantim July 15, 2022 11:27
Comment on lines +3 to +23
#if defined( __clang__ )
#define SUPPRESS_DEPRECATION_WARNING( x ) \
_Pragma( "clang diagnostic push" ) \
_Pragma( "clang diagnostic ignored \"-Wdeprecated-declarations\"" ) \
{ x } \
_Pragma( "clang diagnostic pop" )
#elif defined( __GNUC__ )
#define SUPPRESS_DEPRECATION_WARNING( x ) \
_Pragma( "GCC diagnostic push" ) \
_Pragma( "GCC diagnostic ignored \"-Wdeprecated-declarations\"" ) \
{ x } \
_Pragma( "GCC diagnostic pop" )
#elif defined( _MSC_VER )
#define SUPPRESS_DEPRECATION_WARNING( x ) \
_pragma( warning( push ) ) \
_pragma( warning( disable: 4996 ) ) \
{ x } \
_pragma( warning( pop ) )
#else
#define SUPPRESS_DEPRECATION_WARNING( x ) { x }
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better add separate PUSH and POP macros, and let them have warning in argument

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also lets use it in other places where we suppress warnings

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clang/GCC and MSVC have different warning option formats, unified macros will have to have two arguments to support both of them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented.

Comment on lines +3 to +22
#define STR(...) #__VA_ARGS__

#if defined( __clang__ )
#define SUPPRESS_WARNING_PUSH( x, y ) \
_Pragma( "clang diagnostic push" ) \
_Pragma( STR(clang diagnostic ignored x) )
#elif defined( __GNUC__ )
#define SUPPRESS_WARNING_PUSH( x, y ) \
_Pragma( "GCC diagnostic push ") \
_Pragma( STR(GCC diagnostic ignored x) )
#elif defined( _MSC_VER )
#define SUPPRESS_WARNING_PUSH( x, y ) \
__pragma( warning( push ) ) \
__pragma( warning( disable: y ) )
#else
#define SUPPRESS_WARNING_PUSH( x, y )
#endif

#if defined( __clang__ )
#define SUPPRESS_WARNING_POP \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add MR_ prefix to all new macros

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

#define MR_STR(...) #__VA_ARGS__

#if defined( __clang__ )
#define MR_SUPPRESS_WARNING_PUSH( x, y ) \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a comment that x is GCC/Clang warning id and y is MSVC warning number (or rename x and y)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@oitel oitel merged commit 7234279 into master Jul 15, 2022
@oitel oitel deleted the deprecate_viewport_lines branch July 15, 2022 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants