1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-22 22:13:35 +02:00

Add OpenBSD defines

This commit is contained in:
kirby1 2023-12-14 10:29:42 +03:00
parent 602004591d
commit 5888a20920
4 changed files with 9 additions and 4 deletions

View File

@ -41,6 +41,10 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
# define VCMI_UNIX
# define VCMI_XDG
# define VCMI_FREEBSD
#elif defined(__OpenBSD__)
# define VCMI_UNIX
# define VCMI_XDG
# define VCMI_OPENBSD
#elif defined(__HAIKU__)
# define VCMI_UNIX
# define VCMI_XDG

View File

@ -9,7 +9,7 @@
*/
#pragma once
#ifdef __FreeBSD__
#if defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
@ -55,7 +55,7 @@ public:
private:
si64 clock()
{
#ifdef __FreeBSD__ // TODO: enable also for Apple?
#if defined(__FreeBSD__) || defined(__OpenBSD__) // TODO: enable also for Apple?
struct rusage usage;
getrusage(RUSAGE_SELF, &usage);
return static_cast<si64>(usage.ru_utime.tv_sec + usage.ru_stime.tv_sec) * 1000000 + usage.ru_utime.tv_usec + usage.ru_stime.tv_usec;

View File

@ -14,7 +14,8 @@
#include <windows.h>
#elif defined(VCMI_HAIKU)
#include <OS.h>
#elif !defined(VCMI_APPLE) && !defined(VCMI_FREEBSD) && !defined(VCMI_HURD)
#elif !defined(VCMI_APPLE) && !defined(VCMI_FREEBSD) && \
!defined(VCMI_HURD) && !defined(VCMI_OPENBSD)
#include <sys/prctl.h>
#endif

View File

@ -10,7 +10,7 @@
#pragma once
#if defined(__UCLIBC__) || defined(__FreeBSD__)
#if defined(__UCLIBC__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#undef major
#undef minor
#undef patch