summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-05-09 00:54:34 +0800
committerruki <[email protected]>2020-05-08 23:27:27 +0800
commit08a0d875fdef05a5f9dab726d59d71b5750b9653 (patch)
tree4b5fe5f0c4ee66c3056dfbae9a235577a92eab31
parent6e15213c29915fd2421d54838d04d275f6edfe78 (diff)
add bsd to engine
-rw-r--r--core/src/xmake/engine.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/src/xmake/engine.c b/core/src/xmake/engine.c
index 440b17623..44a58cd06 100644
--- a/core/src/xmake/engine.c
+++ b/core/src/xmake/engine.c
@@ -36,7 +36,7 @@
#elif defined(TB_CONFIG_OS_MACOSX)
# include <unistd.h>
# include <mach-o/dyld.h>
-#elif defined(TB_CONFIG_OS_LINUX) || defined(TB_CONFIG_OS_ANDROID)
+#elif defined(TB_CONFIG_OS_LINUX) || defined(TB_CONFIG_OS_BSD) || defined(TB_CONFIG_OS_ANDROID)
# include <unistd.h>
#endif
@@ -467,7 +467,7 @@ static tb_size_t xm_engine_get_program_file(xm_engine_t* engine, tb_char_t* path
tb_uint32_t bufsize = (tb_uint32_t)maxn;
if (!_NSGetExecutablePath(path, &bufsize))
ok = tb_true;
-#elif defined(TB_CONFIG_OS_LINUX)
+#elif defined(TB_CONFIG_OS_LINUX) || defined(TB_CONFIG_OS_BSD)
// get the executale file path as program directory
ssize_t size = readlink("/proc/self/exe", path, (size_t)maxn);
if (size > 0 && size < maxn)
@@ -630,6 +630,8 @@ static tb_void_t xm_engine_init_host(xm_engine_t* engine)
syshost = "macosx";
#elif defined(TB_CONFIG_OS_LINUX)
syshost = "linux";
+#elif defined(TB_CONFIG_OS_BSD)
+ syshost = "bsd";
#elif defined(TB_CONFIG_OS_IOS)
syshost = "ios";
#elif defined(TB_CONFIG_OS_ANDROID)