mirror of
https://github.com/pine64/blisp.git
synced 2024-12-22 06:20:12 +00:00
Fix build on FreeBSD
This commit is contained in:
parent
3fff531334
commit
a67ab9d218
@ -35,6 +35,11 @@ ssize_t util_get_binary_folder(char* buffer, uint32_t buffer_size) {
|
||||
#elif defined(__APPLE__)
|
||||
util_get_executable_path(buffer, buffer_size);
|
||||
char* pos = strrchr(buffer, '/');
|
||||
#elif __FreeBSD__
|
||||
if (readlink("/proc/curproc/file", buffer, buffer_size) <= 0) {
|
||||
return -1;
|
||||
}
|
||||
char* pos = strrchr(buffer, '/');
|
||||
#else
|
||||
if (GetModuleFileName(NULL, buffer, buffer_size) <= 0) {
|
||||
return -1;
|
||||
|
@ -4,9 +4,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __linux__
|
||||
#include <unistd.h>
|
||||
#elif defined(_MSC_VER)
|
||||
#if defined(_MSC_VER)
|
||||
#include <BaseTsd.h>
|
||||
typedef SSIZE_T ssize_t;
|
||||
#include <windows.h>
|
||||
@ -15,6 +13,8 @@ typedef SSIZE_T ssize_t;
|
||||
#include <sys/syslimits.h>
|
||||
#include <assert.h>
|
||||
#include <sys/types.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
ssize_t util_get_binary_folder(char* buffer, uint32_t buffer_size);
|
||||
|
Loading…
Reference in New Issue
Block a user