Common: Add RESTRICT macro

Gotta coerce the compiler into generating better code.
This commit is contained in:
Stenzek 2024-12-19 16:49:10 +10:00
parent 31c1cfa650
commit 7116a80435
No known key found for this signature in database
1 changed files with 7 additions and 0 deletions

View File

@ -93,6 +93,13 @@ char (&__countof_ArraySizeHelper(T (&array)[N]))[N];
} while (0)
#endif
// __restrict, potentially enables optimization by hinting the compiler that the object is unique.
#ifdef _MSC_VER
#define RESTRICT __restrict
#else
#define RESTRICT __restrict__
#endif
// disable warnings that show up at warning level 4
// TODO: Move to build system instead
#ifdef _MSC_VER