- fixed compilation for Linux and macOS

This commit is contained in:
alexey.lysiuk 2020-04-11 20:36:36 +03:00
parent 76db26ee0b
commit 0d420a75b7
9 changed files with 17 additions and 10 deletions

View File

@ -3,6 +3,8 @@
#ifndef __RESFILE_H #ifndef __RESFILE_H
#define __RESFILE_H #define __RESFILE_H
#include <limits.h>
#include "files.h" #include "files.h"
struct LumpFilterInfo struct LumpFilterInfo

View File

@ -43,6 +43,11 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <time.h> #include <time.h>
#ifndef _WIN32
#include <pwd.h>
#include <unistd.h>
#endif
/* /*
progdir will hold the path up to the game directory, including the slash progdir will hold the path up to the game directory, including the slash

View File

@ -40,13 +40,11 @@
#include <fnmatch.h> #include <fnmatch.h>
#include "cmdlib.h"
static const char *pattern; static const char *pattern;
#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED < 1080
static int matchfile(struct dirent *ent)
#else
static int matchfile(const struct dirent *ent) static int matchfile(const struct dirent *ent)
#endif
{ {
return fnmatch(pattern, ent->d_name, FNM_NOESCAPE) == 0; return fnmatch(pattern, ent->d_name, FNM_NOESCAPE) == 0;
} }

View File

@ -6,6 +6,7 @@
#ifndef _WIN32 #ifndef _WIN32
#include <dirent.h>
struct findstate_t struct findstate_t
{ {

View File

@ -38,10 +38,12 @@
#include <string.h> #include <string.h>
#if defined(__APPLE__) #if defined(__APPLE__)
#include <malloc/malloc.h>
#define _msize(p) malloc_size(p) #define _msize(p) malloc_size(p)
#elif defined(__solaris__) || defined(__OpenBSD__) #elif defined(__solaris__) || defined(__OpenBSD__)
#define _msize(p) (*((size_t*)(p)-1)) #define _msize(p) (*((size_t*)(p)-1))
#elif !defined(_WIN32) #elif !defined(_WIN32)
#include <malloc.h>
#define _msize(p) malloc_usable_size(p) // from glibc/FreeBSD #define _msize(p) malloc_usable_size(p) // from glibc/FreeBSD
#endif #endif

View File

@ -37,7 +37,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <type_traits> #include <type_traits>
#include "doomtype.h" #include "doomtype.h"
#include "m_alloc.h"
#include "vectors.h" #include "vectors.h"
class PClass; class PClass;

View File

@ -69,7 +69,7 @@ class USDFParser : public UDMFParserBase
PClassActor *cls = PClass::FindActor(CheckString(key)); PClassActor *cls = PClass::FindActor(CheckString(key));
if (cls == nullptr) if (cls == nullptr)
{ {
sc.ScriptMessage("Unknown actor class '%s'", key); sc.ScriptMessage("Unknown actor class '%s'", key.GetChars());
return nullptr; return nullptr;
} }
type = cls; type = cls;

View File

@ -2061,6 +2061,7 @@ FSoundChan *OpenALSoundRenderer::FindLowestChannel()
return lowest; return lowest;
} }
#endif // NO_OPENAL
#include "menu/menu.h" #include "menu/menu.h"
@ -2116,5 +2117,3 @@ void I_BuildALResamplersList(FOptionValues* opt)
#endif #endif
} }
#endif // NO_OPENAL

View File

@ -37,7 +37,7 @@
#include <stdio.h> #include <stdio.h>
#include "basics.h" #include "basics.h"
#include "SFMT/SFMTObj.h" #include "sfmt/SFMTObj.h"
class FSerializer; class FSerializer;