mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix & make linux conditionals uniform (#4278)
The source used a hodge-podge of different combinations of different macros to check for linux: 'linux', '__linux', '__linux__'. As '__linux__' is standard (Posix), and the others are not, the source now uniformly uses __linux__. If either linux or __linux are defined, it is made sure that __linux__ is defined as well.
This commit is contained in:
parent
f649147080
commit
1dfd977ec4
5 changed files with 14 additions and 10 deletions
|
@ -60,7 +60,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include <unistd.h>
|
||||
#include <stdint.h> //for uintptr_t
|
||||
|
||||
#if (defined(linux) || defined(__linux) || defined(__GNU__)) && !defined(_GNU_SOURCE)
|
||||
// Use standard Posix macro for Linux
|
||||
#if (defined(linux) || defined(__linux)) && !defined(__linux__)
|
||||
#define __linux__
|
||||
#endif
|
||||
#if (defined(__linux__) || defined(__GNU__)) && !defined(_GNU_SOURCE)
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
|
@ -321,7 +325,7 @@ inline const char *getPlatformName()
|
|||
return
|
||||
#if defined(ANDROID)
|
||||
"Android"
|
||||
#elif defined(linux) || defined(__linux) || defined(__linux__)
|
||||
#elif defined(__linux__)
|
||||
"Linux"
|
||||
#elif defined(_WIN32) || defined(_WIN64)
|
||||
"Windows"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue