SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
22
emulators/gsplus/patches/patch-src_engine_c_c
Normal file
22
emulators/gsplus/patches/patch-src_engine_c_c
Normal file
|
@ -0,0 +1,22 @@
|
|||
Use posix timing to improve portability and avoid a build failure on
|
||||
powerpc due to `__builtin_ppc_mftb' being gcc-specific.
|
||||
|
||||
Index: src/engine_c.c
|
||||
--- src/engine_c.c.orig
|
||||
+++ src/engine_c.c
|
||||
@@ -884,6 +884,15 @@ void fixed_memory_ptrs_shut() {
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
#include <x86intrin.h>
|
||||
+ #elif defined(_POSIX_MONOTONIC_CLOCK)
|
||||
+ #include <time.h>
|
||||
+ int64_t __rdtsc() {
|
||||
+ struct timespec tp = {0};
|
||||
+ int64_t timestamp = 0;
|
||||
+ if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
|
||||
+ timestamp = tp.tv_sec * 1000000000 + tp.tv_nsec;
|
||||
+ return timestamp;
|
||||
+ }
|
||||
#elif defined(__powerpc__) || defined(__ppc__)
|
||||
#define __rdtsc() __builtin_ppc_mftb()
|
||||
#else
|
Loading…
Add table
Add a link
Reference in a new issue