introduces ios support? still needs metal

This commit is contained in:
2025-06-29 01:21:55 +03:00
parent af4f0c3cad
commit cdeaac7c0c
79 changed files with 2176 additions and 1349 deletions

View File

@@ -10,6 +10,9 @@
#include "dlfcn.h"
#include "execinfo.h"
#endif
#ifdef __APPLE__
#include "dlfcn.h"
#endif
#ifdef __WIN32__
#include "windows.h"
#include "dbghelp.h"
@@ -22,7 +25,7 @@ PLATFORM_INTERFACE void Plat_FatalErrorFunc(const char* szFormat, ...)
va_end(list);
fflush(stdout);
raise(SIGTRAP);
_exit(1);
Plat_Exit(1);
}
PLATFORM_INTERFACE void Plat_ListDirRecursive(const char* szPath, ListDirCallbackFn file, ListDirCallbackFn dir)
@@ -163,6 +166,12 @@ PLATFORM_INTERFACE void *Plat_LoadLibrary( const char *psz )
V_printf("Failed to open %s\n\t%s\n", psz, dlerror());
return lib;
#endif
#ifdef __APPLE__
void *lib = dlopen(psz, RTLD_GLOBAL | RTLD_NOW);
if (!lib)
V_printf("Failed to open %s\n\t%s\n", psz, dlerror());
return lib;
#endif
#ifdef __WIN32__
return LoadLibraryA(psz);
#endif
@@ -172,6 +181,9 @@ PLATFORM_INTERFACE void *Plat_GetProc( void *lib, const char *psz )
#ifdef __linux__
return dlsym(lib, psz);
#endif
#ifdef __APPLE__
return dlsym(lib, psz);
#endif
#ifdef __WIN32__
return (void*)GetProcAddress((HMODULE)lib, psz);
#endif
@@ -194,3 +206,13 @@ PLATFORM_INTERFACE double Plat_GetTime( void )
return (tp.tv_sec-s_starttime)+tp.tv_nsec/1e9;
}
PLATFORM_INTERFACE void Plat_Exit( int status )
{
#ifdef __linux__
_exit(status);
#endif
#ifdef __APPLE__
_exit(status);
#endif
};