Merge pull request #534 from cylonicboom/port-osx

osx build
This commit is contained in:
fgsfds authored and GitHub committed 2024-11-19 17:28:02 +01:00
commit 41d5630eec
4 files changed
+17

No files matched your search

+2
View File
@@ -215,6 +215,8 @@ if(NOT GL_LIBRARY)
set(GL_LIBRARY opengl32) set(GL_LIBRARY opengl32)
elseif(NINTENDO_SWITCH) elseif(NINTENDO_SWITCH)
set(GL_LIBRARY EGL glapi drm_nouveau) set(GL_LIBRARY EGL glapi drm_nouveau)
elseif(APPLE)
set(GL_LIBRARY "-framework OpenGL")
else() else()
set(GL_LIBRARY GL) set(GL_LIBRARY GL)
endif() endif()
+8
View File
@@ -31,10 +31,14 @@
#define _OS_LIBC_H_ #define _OS_LIBC_H_
#include "os_pfs.h" #include "os_pfs.h"
#include "platform.h"
#ifndef PLATFORM_N64 #ifndef PLATFORM_N64
#include <stdio.h> #include <stdio.h>
#endif #endif
#ifdef PLATFORM_OSX
#include <strings.h>
#endif
#ifdef _LANGUAGE_C_PLUS_PLUS #ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" { extern "C" {
@@ -84,9 +88,13 @@ extern "C" {
/* byte string operations */ /* byte string operations */
#ifndef PLATFORM_OSX
extern void bcopy(const void *, void *, size_t); extern void bcopy(const void *, void *, size_t);
#endif
extern int bcmp(const void *, const void *, size_t); extern int bcmp(const void *, const void *, size_t);
#ifndef PLATFORM_OSX
extern void bzero(void *, size_t); extern void bzero(void *, size_t);
#endif
/* Printf */ /* Printf */
+3
View File
@@ -6,6 +6,7 @@
#include <errno.h> #include <errno.h>
#include <PR/os_internal.h> #include <PR/os_internal.h>
#include <PR/rcp.h> #include <PR/rcp.h>
#include "platform.h"
#include "system.h" #include "system.h"
#include "input.h" #include "input.h"
#include "video.h" #include "video.h"
@@ -466,6 +467,7 @@ OSIntMask osSetIntMask(OSIntMask mask)
/* libc compatibility wrappers */ /* libc compatibility wrappers */
#ifndef PLATFORM_OSX
#ifndef HAVE_BZERO #ifndef HAVE_BZERO
void bzero(void *ptr, size_t size) void bzero(void *ptr, size_t size)
{ {
@@ -479,6 +481,7 @@ void bcopy(const void *src, void *dst, size_t n)
memcpy(dst, src, n); memcpy(dst, src, n);
} }
#endif #endif
#endif
#ifndef HAVE_BCMP #ifndef HAVE_BCMP
s32 bcmp(const void *s1, const void *s2, size_t n) s32 bcmp(const void *s1, const void *s2, size_t n)
+4
View File
@@ -10,6 +10,10 @@
#elif defined(__linux__) #elif defined(__linux__)
#define PLATFORM_POSIX 1 #define PLATFORM_POSIX 1
#define PLATFORM_LINUX 1 #define PLATFORM_LINUX 1
// add osx
#elif defined(__APPLE__)
#define PLATFORM_POSIX 1
#define PLATFORM_OSX 1
#else #else
// assume POSIX-compatible // assume POSIX-compatible
#define PLATFORM_POSIX 1 #define PLATFORM_POSIX 1