Fix wrong struct used for timeval. Newlib expects 64bits for seconds and PSP expects 32

This commit is contained in:
Francisco Javier Trujillo Mata
2021-11-23 01:31:06 +01:00
parent 6192ee8bdf
commit 98bed321f1
4 changed files with 33 additions and 4 deletions

View File

@@ -30,6 +30,15 @@ extern "C" {
#include <sys/time.h>
/**
* This struct is needed because tv_sec size is different from what newlib expect
* Newlib expects 64bits for seconds and PSP expects 32bits
*/
typedef struct SceKernelTimeval {
uint32_t tv_sec;
uint32_t tv_usec;
} SceKernelTimeval;
/**
* Get the time in seconds since the epoc (1st Jan 1970)
*
@@ -44,7 +53,7 @@ clock_t sceKernelLibcClock(void);
/**
* Get the current time of time and time zone information
*/
int sceKernelLibcGettimeofday(struct timeval *tp, struct timezone *tzp);
int sceKernelLibcGettimeofday(struct SceKernelTimeval *tp, struct timezone *tzp);
/**
* Write back the data cache to memory