Manually define the SWelsTime struct on unix, don't rely on struct timeb

We don't use the ftime function on unix for filling SWelsTime anyway,
we fill the time and millitm fields manually.

On android, the sys/timeb.h header has been removed in the next
platform version (currently available in NDK r10 in the "L preview"
release), since this header and the ftime function have been removed
from the POSIX 2008 specification.

This fixes compilation when targeting the Android "L preview" release,
even when targeting the 32 bit ABIs.
This commit is contained in:
Martin Storsjö 2014-07-16 21:15:30 +03:00
parent 6966679f33
commit 9aaeef9264
2 changed files with 4 additions and 3 deletions

View File

@ -52,7 +52,6 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/timeb.h> #include <sys/timeb.h>
#else #else
#include <sys/timeb.h>
#include <sys/time.h> #include <sys/time.h>
#include "typedefs.h" #include "typedefs.h"
#endif//_WIN32 #endif//_WIN32
@ -72,7 +71,10 @@ typedef FILE WelsFileHandle;
#ifdef _WIN32 #ifdef _WIN32
typedef struct _timeb SWelsTime; typedef struct _timeb SWelsTime;
#else #else
typedef struct timeb SWelsTime; typedef struct TagWelsTime {
time_t time;
unsigned short millitm;
} SWelsTime;
#endif #endif
int32_t WelsSnprintf (char* buffer, int32_t sizeOfBuffer, const char* format, ...); int32_t WelsSnprintf (char* buffer, int32_t sizeOfBuffer, const char* format, ...);

View File

@ -51,7 +51,6 @@
#endif //!_MSC_VER #endif //!_MSC_VER
#else #else
#include <sys/time.h> #include <sys/time.h>
#include <sys/timeb.h>
#endif //_WIN32 #endif //_WIN32
#include "macros.h" #include "macros.h"