This commit is contained in:
2025-05-13 02:46:21 +03:00
parent 143e16692e
commit 86914b7fcc
610 changed files with 92343 additions and 2 deletions
+50
View File
@@ -0,0 +1,50 @@
#ifndef CompilerDetect_h__
#define CompilerDetect_h__
namespace LifeCore{
/*enum CompilerType{
CT_GCC,
CT_Intel,
CT_MwCodewarrior,
CT_MinGw,
CT_BorlandCpp,
CT_Clang,
CT_DigitalMars,
CT_IbmXl,
CT_KeilCArm,
CT_AltiumMbC,
CT_AltiumCthw
}*/
#if defined(__GNUC__)
#define COMPILER_GCC
#elif defined(__INTEL_COMPILER) | (__ICC) | (__ECC) | (__ICL)
#define COMPILER_INTEL
#elif defined(__MWERKS__) | defined(__CWCC__)
#define COMPILER_MW_CODEWARRIOR
#elif defined(_MSC_VER)
#define COMPILER_MSVC
#elif defined(__MINGW32__)
#define COMPILER_MINGW
#define COMPILER_MINGW32
#elif defined(__MINGW64__)
#define COMPILER_MINGW
#define COMPILER_MINGW64
#elif defined(__BORLANDC__) | defined(__CODEGEARC__)
#define COMPILER_BORLAND_CPP
#elif defined(__clang__)
#define COMPILER_CLANG
#elif defined(__DMC__)
#define COMPILER_DIGITALMARS
#elif defined(__xlc__) | defined(__xlC__) | defined(__xlC_ver__) | defined(__IBMC__) | defined(__IBMCPP__)
#define COMPILER_IBM_XL
#elif defined(__CA__) | defined(__KEIL__)
#define COMPILER_KEIL_CARM
#elif defined(__CMB__)
#define COMPILER_ALTIUM_MB_C
#elif defined(__CHC__)
#define COMPILER_ALTIUM_CTHW
#endif
}
#endif // CompilerDetect_h__
+18
View File
@@ -0,0 +1,18 @@
#ifndef Inline_h__
#define Inline_h__
#include "CompilerDetect.h"
namespace LifeCore{
#if defined(COMPILER_MSVC)
#define FORCEINLINE __forceinline
#elif defined(COMPILER_GCC)
#define FORCEINLINE __attribute__((always_inline))
#else
#define FORCEINLINE inline
#endif
#define INLINE inline
}
#endif // Inline_h__
+26
View File
@@ -0,0 +1,26 @@
#ifndef LOsDetect_h__
#define LOsDetect_h__
#include "Inline.h"
namespace LifeCore{
enum OsType{
OsUnknown,
OsWindows,
OsLinux
};
#if defined(_WIN16) || defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__)
#define LOS_WINDOWS
INLINE OsType getOsType(){return OsWindows;}
#elif defined(__gnu_linux__) || defined(__linux__)
#define LOS_LINUX
INLINE OsType getOsType(){return OsLinux;}
#else
#define LOS_UNKNOWN
INLINE OsType getOsType(){return OsUnknown;}
#endif
}
#endif // LOsDetect_h__