mirror of
https://github.com/libretro/RetroArch
synced 2025-03-23 10:20:57 +00:00
DOS/DJGPP buildfix
This commit is contained in:
parent
e6c4327a1c
commit
1d3e1a6962
@ -35,8 +35,10 @@
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_COMMAND
|
||||
#include <net/net_compat.h>
|
||||
#include <net/net_socket.h>
|
||||
#ifdef HAVE_NETWORKING
|
||||
#include <net/net_compat.h>
|
||||
#include <net/net_socket.h>
|
||||
#endif
|
||||
#include <string/stdstring.h>
|
||||
#endif
|
||||
|
||||
|
@ -63,10 +63,10 @@ joypad_connection_t *pad_connection_init(unsigned pads);
|
||||
void pad_connection_destroy(joypad_connection_t *joyconn);
|
||||
|
||||
void pad_connection_pad_deinit(joypad_connection_t *joyconn,
|
||||
unsigned idx);
|
||||
uint32_t idx);
|
||||
|
||||
void pad_connection_packet(joypad_connection_t *joyconn,
|
||||
unsigned idx, uint8_t* data, uint32_t length);
|
||||
uint32_t idx, uint8_t* data, uint32_t length);
|
||||
|
||||
uint64_t pad_connection_get_buttons(joypad_connection_t *joyconn,
|
||||
unsigned idx);
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -152,6 +152,11 @@ else
|
||||
add_define_make MAN_DIR "${PREFIX}/share/man"
|
||||
fi
|
||||
|
||||
if [ "$OS" = 'DOS' ]; then
|
||||
HAVE_SHADERPIPELINE=no
|
||||
HAVE_LANGEXTRA=no
|
||||
fi
|
||||
|
||||
if [ "$OS" = 'Win32' ]; then
|
||||
HAVE_THREADS=yes
|
||||
HAVE_THREAD_STORAGE=yes
|
||||
|
@ -2,6 +2,7 @@
|
||||
if [ -n "$CROSS_COMPILE" ]; then
|
||||
case "$CROSS_COMPILE" in
|
||||
*'-mingw32'*) OS='Win32';;
|
||||
*'-msdosdjgpp'*) OS='DOS';;
|
||||
*);;
|
||||
esac
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user