Skip to content

Commit

Permalink
FreeBSD: We can start (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
ForserX committed Jan 9, 2023
1 parent d3067a3 commit 805bef7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/asura_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
#define OS_UNIX
#endif

#if defined(__FREEBSD__)
#if defined(__FREEBSD__) || defined(__FreeBSD__)
#define OS_BSD
#define OS_UNIX
#endif

#if !defined(OS_LINUX) && !defined(OS_BSD)
#if !defined(OS_LINUX)
#define ASURA_ALLOCATOR_USE
#endif

Expand Down
9 changes: 7 additions & 2 deletions src/engine/audio/opus_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ namespace Asura::Audio::Internal
{
using FileSystem::Reader;

int DecSeak(void* datasource, int64_t offset, int whence)
#ifdef OS_BSD
using offset_type = long long;
#else
using offset_type = int64_t;
#endif
int DecSeak(void* datasource, offset_type offset, int whence)
{
Reader* Data = ((Reader*)datasource);

Expand Down Expand Up @@ -47,7 +52,7 @@ namespace Asura::Audio::Internal
return 0;
}

int64_t DecTell(void* datasource)
offset_type DecTell(void* datasource)
{
return ((Reader*)datasource)->Tell();
}
Expand Down
6 changes: 4 additions & 2 deletions src/engine/core/debug_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ void OutputDebugString(const char* data)

bool GDBDebuggerPresent()
{
int pid = fork();
int res = 0;
#ifndef OS_BSD
int pid = fork();

if (pid == -1)
{
Expand Down Expand Up @@ -77,7 +78,8 @@ bool GDBDebuggerPresent()
waitpid(pid, &status, 0);
res = WEXITSTATUS(status);
}

#endif

return !!res;
}

Expand Down
2 changes: 1 addition & 1 deletion src/engine/render/message_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using Asura::MessageBox::Style;
using Asura::MessageBox::Buttons;
using Asura::MessageBox::Selection;

#if defined(OS_MACOS) || defined(OS_LINUX) || defined(OS_FREEBSD)
#if defined(OS_MACOS) || defined(OS_LINUX) || defined(OS_BSD)
namespace Asura::MessageBox
{
Selection Show(const char* message, const char* title, Style style, Buttons buttons)
Expand Down

0 comments on commit 805bef7

Please sign in to comment.