ref: 9aaeef92645b753d4fca7db5a4f112fd02742304
parent: 6966679f33528afcf568fac367a2438280f55132
author: Martin Storsjö <martin@martin.st>
date: Wed Jul 16 17:15:30 EDT 2014
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.
--- a/codec/common/inc/crt_util_safe_x.h
+++ b/codec/common/inc/crt_util_safe_x.h
@@ -52,7 +52,6 @@
#include <sys/types.h>
#include <sys/timeb.h>
#else
-#include <sys/timeb.h>
#include <sys/time.h>
#include "typedefs.h"
#endif//_WIN32
@@ -72,7 +71,10 @@
#ifdef _WIN32
typedef struct _timeb SWelsTime;
#else
-typedef struct timeb SWelsTime;
+typedef struct TagWelsTime {
+ time_t time;
+ unsigned short millitm;
+} SWelsTime;
#endif
int32_t WelsSnprintf (char* buffer, int32_t sizeOfBuffer, const char* format, ...);
--- a/codec/common/src/crt_util_safe_x.cpp
+++ b/codec/common/src/crt_util_safe_x.cpp
@@ -51,7 +51,6 @@
#endif //!_MSC_VER
#else
#include <sys/time.h>
-#include <sys/timeb.h>
#endif //_WIN32
#include "macros.h"