diff --git a/include/bx/os.h b/include/bx/os.h index 6e70b30..0bdeb3c 100644 --- a/include/bx/os.h +++ b/include/bx/os.h @@ -16,6 +16,7 @@ #elif BX_PLATFORM_ANDROID \ || BX_PLATFORM_EMSCRIPTEN \ || BX_PLATFORM_BSD \ + || BX_PLATFORM_HURD \ || BX_PLATFORM_IOS \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_NACL \ @@ -51,6 +52,8 @@ # include # elif BX_PLATFORM_OSX # include // mach_task_basic_info +# elif BX_PLATFORM_HURD +# include // getpid # elif BX_PLATFORM_ANDROID # include "debug.h" // getTid is not implemented... # endif // BX_PLATFORM_ANDROID @@ -110,6 +113,8 @@ namespace bx #elif BX_PLATFORM_BSD || BX_PLATFORM_NACL // Casting __nc_basic_thread_data*... need better way to do this. return *(uint32_t*)::pthread_self(); +#elif BX_PLATFORM_HURD + return (pthread_t)::pthread_self(); #else //# pragma message "not implemented." debugOutput("getTid is not implemented"); debugBreak(); @@ -122,7 +127,7 @@ namespace bx #if BX_PLATFORM_ANDROID struct mallinfo mi = mallinfo(); return mi.uordblks; -#elif BX_PLATFORM_LINUX +#elif BX_PLATFORM_LINUX || BX_PLATFORM_HURD FILE* file = fopen("/proc/self/statm", "r"); if (NULL == file) { diff --git a/include/bx/platform.h b/include/bx/platform.h index ce5365e..02a8004 100644 --- a/include/bx/platform.h +++ b/include/bx/platform.h @@ -39,6 +39,7 @@ #define BX_PLATFORM_ANDROID 0 #define BX_PLATFORM_EMSCRIPTEN 0 #define BX_PLATFORM_BSD 0 +#define BX_PLATFORM_HURD 0 #define BX_PLATFORM_IOS 0 #define BX_PLATFORM_LINUX 0 #define BX_PLATFORM_NACL 0 @@ -227,6 +228,9 @@ #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) # undef BX_PLATFORM_BSD # define BX_PLATFORM_BSD 1 +#elif defined(__GNU__) +# undef BX_PLATFORM_HURD +# define BX_PLATFORM_HURD 1 #else # error "BX_PLATFORM_* is not defined!" #endif // @@ -235,6 +239,7 @@ || BX_PLATFORM_ANDROID \ || BX_PLATFORM_EMSCRIPTEN \ || BX_PLATFORM_BSD \ + || BX_PLATFORM_HURD \ || BX_PLATFORM_IOS \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_NACL \ @@ -285,6 +290,8 @@ BX_STRINGIZE(__EMSCRIPTEN_tiny__) #elif BX_PLATFORM_BSD # define BX_PLATFORM_NAME "BSD" +#elif BX_PLATFORM_HURD +# define BX_PLATFORM_NAME "Hurd" #elif BX_PLATFORM_IOS # define BX_PLATFORM_NAME "iOS" #elif BX_PLATFORM_LINUX diff --git a/include/bx/process.h b/include/bx/process.h index d643181..4e4b151 100644 --- a/include/bx/process.h +++ b/include/bx/process.h @@ -9,16 +9,16 @@ #include "string.h" #include "uint32_t.h" -#if BX_PLATFORM_LINUX +#if BX_PLATFORM_LINUX || BX_PLATFORM_HURD # include -#endif // BX_PLATFORM_LINUX +#endif // BX_PLATFORM_LINUX || BX_PLATFORM_HURD namespace bx { /// inline void* exec(const char* const* _argv) { -#if BX_PLATFORM_LINUX +#if BX_PLATFORM_LINUX || BX_PLATFORM_HURD pid_t pid = fork(); if (0 == pid) @@ -72,7 +72,7 @@ namespace bx return NULL; #else return NULL; -#endif // BX_PLATFORM_LINUX +#endif // BX_PLATFORM_LINUX || BX_PLATFORM_HURD } } // namespace bx diff --git a/include/bx/thread.h b/include/bx/thread.h index 2d92345..155e9f5 100644 --- a/include/bx/thread.h +++ b/include/bx/thread.h @@ -157,7 +157,7 @@ namespace bx { #if BX_PLATFORM_OSX || BX_PLATFORM_IOS pthread_setname_np(_name); -#elif (BX_CRT_GLIBC >= 21200) +#elif (BX_CRT_GLIBC >= 21200) && ! BX_PLATFORM_HURD pthread_setname_np(m_handle, _name); #elif BX_PLATFORM_LINUX prctl(PR_SET_NAME,_name, 0, 0, 0); diff --git a/makefile b/makefile index 3093021..19180d4 100644 --- a/makefile +++ b/makefile @@ -181,7 +181,7 @@ clean: SILENT ?= @ UNAME := $(shell uname) -ifeq ($(UNAME),$(filter $(UNAME),Linux Darwin)) +ifeq ($(UNAME),$(filter $(UNAME),Linux GNU Darwin)) ifeq ($(UNAME),$(filter $(UNAME),Darwin)) OS=darwin BUILD_PROJECT_DIR=gmake-osx diff --git a/tools/bin/linux/genie b/tools/bin/linux/genie index 591ef37..e8c9a52 100755 Binary files a/tools/bin/linux/genie and b/tools/bin/linux/genie differ