Photon Common Library 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
compiler.h
Go to the documentation of this file.
1#pragma once
2
20// TODO: distinguish between versions
21
22#if defined(__clang__)
23 #define PH_COMPILER_IS_CLANG 1
24#elif defined(__GNUG__)
25 #define PH_COMPILER_IS_GNU 1
26#elif defined(_MSC_VER)
27 #define PH_COMPILER_IS_MSVC 1
28#endif
29
30#ifndef PH_COMPILER_IS_CLANG
31 #define PH_COMPILER_IS_CLANG 0
32#endif
33
34#ifndef PH_COMPILER_IS_GNU
35 #define PH_COMPILER_IS_GNU 0
36#endif
37
38#ifndef PH_COMPILER_IS_MSVC
39 #define PH_COMPILER_IS_MSVC 0
40#endif
41
42#if PH_COMPILER_IS_MSVC
43 #define PH_ALWAYS_INLINE msvc::forceinline
44#elif PH_COMPILER_IS_GNU
45 #define PH_ALWAYS_INLINE gnu::always_inline
46#elif PH_COMPILER_IS_CLANG
47 #define PH_ALWAYS_INLINE clang::always_inline
48#else
49 #error "Unrecognized compiler: cannot define `PH_ALWAYS_INLINE`"
50#endif