diff --git a/core/include/fx/core/thread.h b/core/include/fx/core/thread.h index cf5cab8..54dbee8 100644 --- a/core/include/fx/core/thread.h +++ b/core/include/fx/core/thread.h @@ -5,7 +5,7 @@ #include #include -#if defined(__APPLE__) || defined(__linux__) +#if defined(__APPLE__) || defined(__linux__) || defined(__rosetta__) #include #define FX_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER diff --git a/core/sys/rosetta/bitop.c b/core/sys/rosetta/bitop.c new file mode 100644 index 0000000..3653953 --- /dev/null +++ b/core/sys/rosetta/bitop.c @@ -0,0 +1,16 @@ +#include + +int fx_popcountl(long v) +{ + return __builtin_popcountl(v); +} + +int fx_ctzl(long v) +{ + return __builtin_ctzl(v); +} + +int fx_clzl(long v) +{ + return __builtin_clzl(v); +} diff --git a/core/sys/rosetta/random.c b/core/sys/rosetta/random.c new file mode 100644 index 0000000..c748d31 --- /dev/null +++ b/core/sys/rosetta/random.c @@ -0,0 +1,13 @@ +#include +#include +#include + +uint64_t z__fx_platform_random_seed() +{ + return 0; +} + +uint64_t z__fx_platform_random_seed_secure() +{ + return 0; +}