separate header file for OS detection

This commit is contained in:
otavepto 2024-06-29 06:46:07 +03:00
parent 15bc66a1da
commit e03ed9e1cd
2 changed files with 34 additions and 21 deletions

View File

@ -19,27 +19,7 @@
#define __INCLUDED_COMMON_INCLUDES__
// OS detection
#if defined(WIN64) || defined(_WIN64) || defined(__MINGW64__)
#define __WINDOWS_64__
#elif defined(WIN32) || defined(_WIN32) || defined(__MINGW32__)
#define __WINDOWS_32__
#endif
#if defined(__WINDOWS_32__) || defined(__WINDOWS_64__)
#define __WINDOWS__
#endif
#if defined(__linux__) || defined(linux)
#if defined(__x86_64__)
#define __LINUX_64__
#else
#define __LINUX_32__
#endif
#endif
#if defined(__LINUX_32__) || defined(__LINUX_64__)
#define __LINUX__
#endif
#include "common_helpers/os_detector.h"
#if defined(__WINDOWS__)
#define STEAM_WIN32

View File

@ -0,0 +1,33 @@
#ifndef __INCLUDED_OS_DETECTOR__
#define __INCLUDED_OS_DETECTOR__
#if defined(WIN64) || defined(_WIN64) || defined(__MINGW64__)
#define __WINDOWS_64__
#elif defined(WIN32) || defined(_WIN32) || defined(__MINGW32__)
#define __WINDOWS_32__
#endif
#if defined(__WINDOWS_32__) || defined(__WINDOWS_64__)
#define __WINDOWS__
#endif
#if defined(__linux__) || defined(linux)
#if defined(__x86_64__)
#define __LINUX_64__
#else
#define __LINUX_32__
#endif
#endif
#if defined(__LINUX_32__) || defined(__LINUX_64__)
#define __LINUX__
#endif
// https://sourceforge.net/p/predef/wiki/OperatingSystems/
#if defined(__APPLE__) || defined(macintosh) || defined(Macintosh) || defined(__MACH__)
#define __MACOS__
#endif
#endif