diff --git a/source/lib/sysdep/unix/dir_watch_fam.cpp b/source/lib/sysdep/linux/dir_watch_fam.cpp similarity index 100% rename from source/lib/sysdep/unix/dir_watch_fam.cpp rename to source/lib/sysdep/linux/dir_watch_fam.cpp diff --git a/source/lib/sysdep/linux/linux.cpp b/source/lib/sysdep/linux/linux.cpp new file mode 100644 index 0000000000..e565dfa7cc --- /dev/null +++ b/source/lib/sysdep/linux/linux.cpp @@ -0,0 +1,22 @@ +#include "precompiled.h" + +#include "lib/sysdep/sysdep.h" + +#define GNU_SOURCE +#include + +LibError sys_get_executable_name(char* n_path, size_t buf_size) +{ + Dl_info dl_info; + + memset(&dl_info, 0, sizeof(dl_info)); + if (!dladdr((void *)sys_get_executable_name, &dl_info) || + !dl_info.dli_fname ) + { + return ERR::NO_SYS; + } + + strncpy(n_path, dl_info.dli_fname, buf_size); + return INFO::OK; +} + diff --git a/source/lib/sysdep/osx/dir_watch.cpp b/source/lib/sysdep/osx/dir_watch.cpp index e88fcdd9be..a39017164f 100644 --- a/source/lib/sysdep/osx/dir_watch.cpp +++ b/source/lib/sysdep/osx/dir_watch.cpp @@ -3,12 +3,14 @@ // stub implementations -LibError dir_add_watch(const char * const n_full_path, intptr_t* const watch) +LibError dir_add_watch( + const char * const UNUSED(n_full_path), + intptr_t* const UNUSED(watch)) { return INFO::OK; } -LibError dir_cancel_watch(const intptr_t watch) +LibError dir_cancel_watch(const intptr_t UNUSED(watch)) { return INFO::OK; } diff --git a/source/lib/sysdep/osx/odbg.cpp b/source/lib/sysdep/osx/odbg.cpp new file mode 100644 index 0000000000..7f0c37b2ec --- /dev/null +++ b/source/lib/sysdep/osx/odbg.cpp @@ -0,0 +1,24 @@ +// note: the BFD stuff *could* be used on other platforms, if we saw the +// need for it. + +#include "precompiled.h" + +#include "lib/sysdep/sysdep.h" +#include "lib/debug.h" + +void* debug_get_nth_caller(uint UNUSED(n), void *UNUSED(context)) +{ + return NULL; +} + +LibError debug_dump_stack(wchar_t* UNUSED(buf), size_t UNUSED(max_chars), uint UNUSED(skip), void* UNUSED(context)) +{ + return ERR::NOT_IMPLEMENTED; +} + +LibError debug_resolve_symbol(void* UNUSED(ptr_of_interest), char* UNUSED(sym_name), char* UNUSED(file), int* UNUSED(line)) +{ + return ERR::NOT_IMPLEMENTED; +} + + diff --git a/source/lib/sysdep/osx/osx.cpp b/source/lib/sysdep/osx/osx.cpp index 730e906897..4b4ebf122a 100644 --- a/source/lib/sysdep/osx/osx.cpp +++ b/source/lib/sysdep/osx/osx.cpp @@ -54,24 +54,24 @@ LibError gfx_get_video_mode(int* xres, int* yres, int* bpp, int* freq) return ERR::NOT_IMPLEMENTED; } - -LibError sys_get_executable_name(char* n_path, size_t buf_size) -{ - static char name[PATH_MAX]; - static bool init = false; - if ( !init ) - { - init = true; - char temp[PATH_MAX]; - u32 size = PATH_MAX; - if (_NSGetExecutablePath( temp, &size )) - { - return ERR::NO_SYS; - } - debug_printf("exe name before realpath: %s\n", temp); - realpath(temp, name); - } - strncpy(n_path, name, buf_size); - debug_printf("exe name: %s\n", name); - return INFO::OK; -} + +LibError sys_get_executable_name(char* n_path, size_t buf_size) +{ + static char name[PATH_MAX]; + static bool init = false; + if ( !init ) + { + init = true; + char temp[PATH_MAX]; + u32 size = PATH_MAX; + if (_NSGetExecutablePath( temp, &size )) + { + return ERR::NO_SYS; + } + debug_printf("exe name before realpath: %s\n", temp); + realpath(temp, name); + } + strncpy(n_path, name, buf_size); + debug_printf("exe name: %s\n", name); + return INFO::OK; +} diff --git a/source/lib/sysdep/unix/unix.cpp b/source/lib/sysdep/unix/unix.cpp index 16a3981dcc..d668c7072f 100644 --- a/source/lib/sysdep/unix/unix.cpp +++ b/source/lib/sysdep/unix/unix.cpp @@ -25,23 +25,6 @@ void sys_display_msgw(const wchar_t* caption, const wchar_t* msg) fwprintf(stderr, L"%ls: %ls\n", caption, msg); } - -LibError sys_get_executable_name(char* n_path, size_t buf_size) -{ - Dl_info dl_info; - - memset(&dl_info, 0, sizeof(dl_info)); - if (!dladdr((void *)sys_get_executable_name, &dl_info) || - !dl_info.dli_fname ) - { - return ERR::NO_SYS; - } - - strncpy(n_path, dl_info.dli_fname, buf_size); - return INFO::OK; -} - - ErrorReaction sys_display_error(const wchar_t* text, uint flags) { printf("%ls\n\n", text);