Skip to content

Commit

Permalink
Fix for c++17 deprecated register warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackvoxel committed Aug 5, 2021
1 parent a56d471 commit 51aa78b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/z/ZTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@

#define MulticharConst(a,b,c,d) (a + (b << 8) + (c<<16) + (d<<24))

// Fix register keyword deprecated

#if __cplusplus > 199711L
#define register
#endif


enum {ZFALSE = false ,ZTRUE = true};
enum {ZERROR = 0, ZSUCCESS =-1};

Expand Down

2 comments on commit 51aa78b

@ElementW
Copy link

@ElementW ElementW commented on 51aa78b Sep 3, 2021

Choose a reason for hiding this comment

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

That's a dirty fix if anything. register hasn't had any meaningful use in C++ for decades now; remotely modern compilers (anything after ~2005) ignore the qualifier entirely when considering optimizing variable use (because you are not smarter than the compiler's optimizer), so the proper solution would be getting rid of all register uses in the codebase.

@Blackvoxel
Copy link
Owner Author

Choose a reason for hiding this comment

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

Hello ElementW,

Thanks for your suggestion and your interest for Blackvoxel.

We have taken note of your suggestion and will think about it.

Have a good day,
The Blackvoxel Team.

Please sign in to comment.