Hello,
I get the following compilation error. test.c and the fix are below. Hexagon SDK version: 3.2.
In file included from test.c:3:
C:\Qualcomm\Hexagon_SDK\3.2\tools\HEXAGON_Tools\8.0.10\Tools\target\hexagon\include\sys/time.h:50:8: error: redefinition of 'timeval'
struct timeval {
^
C:\Qualcomm\Hexagon_SDK\3.2\libs\common\qurt\ADSPv62MPCPP\include\posix\common/time.h:22:8: note: previous definition is here
struct timeval
^
1 error generated.
test.c:
#include <pthread.h>
#include <sys/time.h>
time.diff (the fix):
--- Hexagon_SDK/3.2/libs/common/qurt/ADSPv62MPCPP/include/posix/common/time.h.orig 2017-06-04 21:37:16.143823700 +0300
+++ Hexagon_SDK/3.2/libs/common/qurt/ADSPv62MPCPP/include/posix/common/time.h 2017-06-08 19:45:40.688822200 +0300
@@ -19,11 +19,14 @@
#define _PROVIDE_POSIX_TIME_DECLS 1
#include <generic/time.h>
+#ifndef _STRUCT_TIMEVAL
+#define _STRUCT_TIMEVAL 1
struct timeval
{
time_t tv_sec; /* Seconds. */
long tv_usec; /* microseconds. */
};
+#endif
struct itimerspec
{
--- Hexagon_SDK/3.2/tools/HEXAGON_Tools/8.0.10/Tools/target/hexagon/include/sys/time.h.orig 2017-06-04 21:37:07.889823700 +0300
+++ Hexagon_SDK/3.2/tools/HEXAGON_Tools/8.0.10/Tools/target/hexagon/include/sys/time.h 2017-06-08 19:46:01.995822200 +0300
@@ -47,10 +47,14 @@
* and used in other calls.
*/
_C_STD_BEGIN
+
+#ifndef _STRUCT_TIMEVAL
+#define _STRUCT_TIMEVAL 1
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* and microseconds */
};
+#endif
_EXTERN_C /* declarations */
int sys_gettimeofday(struct timeval *_Restrict, void *_Restrict) _NO_THROW;