mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 15:02:01 +00:00
Fixed non-portable usage of __solaris__ preprocessor definition
GCC: this use of "defined" may not be portable [-Wexpansion-to-defined] Clang: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
This commit is contained in:
parent
1e7b692c77
commit
5f7a06c66e
2 changed files with 7 additions and 5 deletions
|
@ -54,14 +54,14 @@
|
|||
#endif
|
||||
#if defined(__APPLE__)
|
||||
#define _msize(p) malloc_size(p)
|
||||
#elif __solaris__ || defined(__OpenBSD__)
|
||||
#elif defined(__solaris__) || defined(__OpenBSD__)
|
||||
#define _msize(p) (*((size_t*)(p)-1))
|
||||
#elif !defined(_WIN32)
|
||||
#define _msize(p) malloc_usable_size(p) // from glibc/FreeBSD
|
||||
#endif
|
||||
|
||||
#ifndef _DEBUG
|
||||
#if !__solaris__ && !defined(__OpenBSD__)
|
||||
#if !defined(__solaris__) && !defined(__OpenBSD__)
|
||||
void *M_Malloc(size_t size)
|
||||
{
|
||||
void *block = malloc(size);
|
||||
|
@ -131,7 +131,7 @@ void *M_Realloc(void *memblock, size_t size)
|
|||
#include <crtdbg.h>
|
||||
#endif
|
||||
|
||||
#if !__solaris__ && !defined(__OpenBSD__)
|
||||
#if !defined(__solaris__) && !defined(__OpenBSD__)
|
||||
void *M_Malloc_Dbg(size_t size, const char *file, int lineno)
|
||||
{
|
||||
void *block = _malloc_dbg(size, _NORMAL_BLOCK, file, lineno);
|
||||
|
@ -199,7 +199,7 @@ void *M_Realloc_Dbg(void *memblock, size_t size, const char *file, int lineno)
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if !__solaris__ && !defined(__OpenBSD__)
|
||||
#if !defined(__solaris__) && !defined(__OpenBSD__)
|
||||
void M_Free (void *block)
|
||||
{
|
||||
if (block != NULL)
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
#include <dirent.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#define __solaris__ (defined(__sun) || defined(__sun__) || defined(__SRV4) || defined(__srv4__))
|
||||
#if defined(__sun) || defined(__sun__) || defined(__SRV4) || defined(__srv4__)
|
||||
#define __solaris__ 1
|
||||
#endif
|
||||
|
||||
#include "doomtype.h"
|
||||
|
||||
|
|
Loading…
Reference in a new issue