REDRIVER2/src_rebuild/Game/platform.h

44 lines
743 B
C
Raw Normal View History

#ifndef PLATFORM_H
#define PLATFORM_H
2020-11-24 11:14:47 +01:00
#include "STRINGS.H"
#ifdef _WIN32
#include <direct.h>
2020-10-10 20:03:53 +02:00
#define HOME_ENV "USERPROFILE"
inline void FixPathSlashes(char* pathbuff)
{
while (*pathbuff)
{
if (*pathbuff == '/') // make windows-style path
*pathbuff = '\\';
pathbuff++;
}
}
#elif defined (__unix__)
#include <sys/stat.h>
2020-10-10 20:03:53 +02:00
#define HOME_ENV "HOME"
#define _mkdir(str) mkdir(str, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)
inline void FixPathSlashes(char* pathbuff)
{
while (*pathbuff)
{
if (*pathbuff == '\\') // make unix-style path
*pathbuff = '/';
pathbuff++;
}
}
#endif
#ifdef __GNUC__
#define _stricmp(s1, s2) strcasecmp(s1, s2)
#endif
#endif // PLATFORM_H