platform abi

This commit is contained in:
2026-01-09 18:27:46 +02:00
parent 64459718b0
commit 41aebdf8e8

View File

@@ -9,8 +9,10 @@
#ifdef __linux__ #ifdef __linux__
#include "dlfcn.h" #include "dlfcn.h"
#ifdef __GLIBC__
#include "execinfo.h" #include "execinfo.h"
#endif #endif
#endif
#ifdef __APPLE__ #ifdef __APPLE__
#include "dlfcn.h" #include "dlfcn.h"
#endif #endif
@@ -119,12 +121,16 @@ PLATFORM_INTERFACE char *Plat_GetExtension( const char *szPath )
} }
PLATFORM_INTERFACE void Plat_MakeDir( const char *szPath, int iPermissions ) PLATFORM_INTERFACE void Plat_MakeDir( const char *szPath, int iPermissions )
{ {
#ifndef ACCESSPERMS
#define ACCESSPERMS 0777
#endif
mkdir(szPath, ACCESSPERMS); mkdir(szPath, ACCESSPERMS);
} }
PLATFORM_INTERFACE void Plat_Backtrace( void ) PLATFORM_INTERFACE void Plat_Backtrace( void )
{ {
#ifdef __linux__ #ifdef __linux__
#ifdef __GLIBC__
void *buffer[64]; void *buffer[64];
int nptrs = backtrace(buffer, 64); int nptrs = backtrace(buffer, 64);
char **symbols = backtrace_symbols(buffer, nptrs); char **symbols = backtrace_symbols(buffer, nptrs);
@@ -140,6 +146,7 @@ PLATFORM_INTERFACE void Plat_Backtrace( void )
free(symbols); free(symbols);
#endif #endif
#endif
#ifdef __WIN32__ #ifdef __WIN32__
/* /*
void* buffer[64]; void* buffer[64];