Fix mac exe path and mac debugging
This commit is contained in:
@@ -386,13 +386,20 @@ OS_API OS_Date OS_GetDate(void) {
|
||||
#include <time.h>
|
||||
#include <dirent.h>
|
||||
|
||||
OS_API bool OS_EnableTerminalColors(void) { return true; }
|
||||
#if OS_MAC
|
||||
|
||||
OS_API bool OS_IsAbsolute(S8_String path) {
|
||||
bool result = path.len >= 1 && path.str[0] == '/';
|
||||
OS_API S8_String OS_GetExePath(MA_Arena *arena) {
|
||||
char buf[PATH_MAX];
|
||||
uint32_t bufsize = PATH_MAX;
|
||||
if (_NSGetExecutablePath(buf, &bufsize)) {
|
||||
return S8_MakeEmpty();
|
||||
}
|
||||
S8_String result = S8_Copy(arena, S8_Make(buf, bufsize));
|
||||
return result;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
OS_API S8_String OS_GetExePath(MA_Arena *arena) {
|
||||
char buffer[PATH_MAX] = {};
|
||||
if (readlink("/proc/self/exe", buffer, PATH_MAX) == -1) {
|
||||
@@ -402,6 +409,15 @@ OS_API S8_String OS_GetExePath(MA_Arena *arena) {
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
OS_API bool OS_EnableTerminalColors(void) { return true; }
|
||||
|
||||
OS_API bool OS_IsAbsolute(S8_String path) {
|
||||
bool result = path.len >= 1 && path.str[0] == '/';
|
||||
return result;
|
||||
}
|
||||
|
||||
OS_API S8_String OS_GetExeDir(MA_Arena *arena) {
|
||||
S8_String path = OS_GetExePath(arena);
|
||||
S8_String dir = S8_ChopLastSlash(path);
|
||||
|
||||
@@ -6,21 +6,34 @@
|
||||
|
||||
int main() {
|
||||
TestSimpleInsertAndIntegrity();
|
||||
IO_Printf("TestSimpleInsertAndIntegrity() - DONE\n");
|
||||
TestStrings();
|
||||
IO_Printf("TestStrings() - DONE\n");
|
||||
|
||||
TestExclusiveArenaBackedArray();
|
||||
IO_Printf("TestExclusiveArenaBackedArray() - DONE\n");
|
||||
TestRemoveForLoop();
|
||||
IO_Printf("TestRemoveForLoop() - DONE\n");
|
||||
TestBasic();
|
||||
IO_Printf("TestBasic() - DONE\n");
|
||||
TestReverseLoop();
|
||||
IO_Printf("TestReverseLoop() - DONE\n");
|
||||
TestCopy();
|
||||
IO_Printf("TestCopy() - DONE\n");
|
||||
|
||||
TestBuffer();
|
||||
IO_Printf("TestBuffer() - DONE\n");
|
||||
TestCreateAllocate();
|
||||
IO_Printf("TestCreateAllocate() - DONE\n");
|
||||
TestBootstrap();
|
||||
IO_Printf("TestBootstrap() - DONE\n");
|
||||
TestBootstrapExclusive();
|
||||
IO_Printf("TestBootstrapExclusive() - DONE\n");
|
||||
TestBootstrapArenaClear();
|
||||
IO_Printf("TestBootstrapArenaClear() - DONE\n");
|
||||
|
||||
TestClexer();
|
||||
IO_Printf("TestClexer() - DONE\n");
|
||||
|
||||
// Unicode iteration over codepoints using For
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user