Skip to content

Commit

Permalink
Add missing Common header
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCurle committed Apr 5, 2024
1 parent 35fcb53 commit b966237
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions projs/shadow/shadow-engine/platforms/inc/shadow/platform/Common.h
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;
};

0 comments on commit b966237

Please sign in to comment.