-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
projs/shadow/shadow-engine/platforms/inc/shadow/platform/Common.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma once | ||
|
||
#ifdef __linux__ | ||
#define ifsystem(linux,windows,apple) linux | ||
#elif __WIN32 | ||
#define ifsystem(linux,windows,apple) windows | ||
#elif __APPLE__ | ||
#define ifsystem(linux,windows,apple) apple | ||
#endif | ||
|
||
// Clang on macOS has __GNUC__ defined to 4, for some reason. | ||
#ifdef __clang__ | ||
#define ifcompiler(gcc,clang,msvc) clang | ||
#elif __GNUC__ | ||
#define ifcompiler(gcc,clang,msvc) gcc | ||
#elif _MSC_VER | ||
#define ifcompiler(gcc,clang,msvc) msvc | ||
#endif | ||
|
||
template <typename T, uint32_t count> constexpr uint32_t lengthOf(const T (&)[count]) { | ||
return count; | ||
}; |