game_launcher
1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
Loading...
Searching...
No Matches
platform.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
#pragma once
3
4
// Platform detection macros
5
#if defined(_WIN32) || defined(_WIN64)
6
#define PLATFORM_WINDOWS 1
7
#define PLATFORM_NAME "Windows"
8
#elif defined(__linux__)
9
#define PLATFORM_LINUX 1
10
#define PLATFORM_NAME "Linux"
11
#elif defined(__APPLE__)
12
#define PLATFORM_MACOS 1
13
#define PLATFORM_NAME "macOS"
14
#else
15
#error "Unsupported platform"
16
#endif
17
18
// Common platform utilities
19
namespace
platform
20
{
21
22
inline
const
char
*
getPlatformName
()
23
{
24
return
PLATFORM_NAME;
25
}
26
27
inline
bool
isWindows
()
28
{
29
#ifdef PLATFORM_WINDOWS
30
return
true
;
31
#else
32
return
false
;
33
#endif
34
}
35
36
inline
bool
isLinux
()
37
{
38
#ifdef PLATFORM_LINUX
39
return
true
;
40
#else
41
return
false
;
42
#endif
43
}
44
45
}
// namespace platform
platform
Definition
paths.h:9
platform::getPlatformName
const char * getPlatformName()
Definition
platform.h:22
platform::isLinux
bool isLinux()
Definition
platform.h:36
platform::isWindows
bool isWindows()
Definition
platform.h:27
core
include
platform
platform.h
Generated by
1.16.1