mirror of
https://github.com/libretro/libretro-common.git
synced 2024-06-23 06:32:43 -04:00
Updates
This commit is contained in:
parent
3530655b5a
commit
d2d8ca95d5
|
@ -44,7 +44,7 @@
|
|||
#endif
|
||||
#elif defined(_XBOX360)
|
||||
#include <PPCIntrinsics.h>
|
||||
#elif defined(_POSIX_MONOTONIC_CLOCK) || defined(ANDROID) || defined(__QNX__)
|
||||
#elif defined(_POSIX_MONOTONIC_CLOCK) || defined(ANDROID) || defined(__QNX__) || defined(DJGPP)
|
||||
/* POSIX_MONOTONIC_CLOCK is not being defined in Android headers despite support being present. */
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
@ -215,7 +215,7 @@ retro_time_t cpu_features_get_time_usec(void)
|
|||
return tv.tv_sec * INT64_C(1000000) + (tv.tv_nsec + 500) / 1000;
|
||||
#elif defined(EMSCRIPTEN)
|
||||
return emscripten_get_now() * 1000;
|
||||
#elif defined(__mips__)
|
||||
#elif defined(__mips__) || defined(DJGPP)
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv,NULL);
|
||||
return (1000000 * tv.tv_sec + tv.tv_usec);
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <retro_common_api.h>
|
||||
#include <retro_inline.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_MSC_VER) && !defined(_XBOX)
|
||||
#if (_MSC_VER > 1310)
|
||||
#include <intrin.h>
|
||||
#endif
|
||||
|
|
|
@ -39,7 +39,7 @@ static INLINE float float_min(float a, float b)
|
|||
#ifdef __SSE2__
|
||||
_mm_store_ss( &a, _mm_min_ss(_mm_set_ss(a),_mm_set_ss(b)) );
|
||||
return a;
|
||||
#elif defined(__STDC_C99__) || defined(__STDC_C11__)
|
||||
#elif !defined(DJGPP) && (defined(__STDC_C99__) || defined(__STDC_C11__))
|
||||
return fminf(a, b);
|
||||
#else
|
||||
return MIN(a, b);
|
||||
|
@ -51,7 +51,7 @@ static INLINE float float_max(float a, float b)
|
|||
#ifdef __SSE2__
|
||||
_mm_store_ss( &a, _mm_max_ss(_mm_set_ss(a),_mm_set_ss(b)) );
|
||||
return a;
|
||||
#elif defined(__STDC_C99__) || defined(__STDC_C11__)
|
||||
#elif !defined(DJGPP) && (defined(__STDC_C99__) || defined(__STDC_C11__))
|
||||
return fmaxf(a, b);
|
||||
#else
|
||||
return MAX(a, b);
|
||||
|
|
|
@ -83,6 +83,26 @@
|
|||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
||||
#define RARCH_SCALE_BASE 256
|
||||
|
||||
#ifdef DJGPP
|
||||
#define timespec timeval
|
||||
#define tv_nsec tv_usec
|
||||
#include <unistd.h>
|
||||
|
||||
extern int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
|
||||
|
||||
static int nanosleepDOS(const struct timespec *rqtp, struct timespec *rmtp)
|
||||
{
|
||||
usleep(1000000 * rqtp->tv_sec + rqtp->tv_nsec / 1000);
|
||||
|
||||
if (rmtp)
|
||||
rmtp->tv_sec = rmtp->tv_nsec=0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define nanosleep nanosleepDOS
|
||||
#endif
|
||||
|
||||
/**
|
||||
* retro_sleep:
|
||||
* @msec : amount in milliseconds to sleep
|
||||
|
|
Loading…
Reference in a new issue