libc: indicate timeval is defined
In order to avoid multiple definition errors, indicate that struct timeval is declared. Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
This commit is contained in:
committed by
Chris Friedt
parent
192b721732
commit
9f13274c00
@@ -23,5 +23,6 @@ struct timeval {
|
||||
time_t tv_sec;
|
||||
suseconds_t tv_usec;
|
||||
};
|
||||
#define __timeval_defined
|
||||
|
||||
#endif /* ZEPHYR_LIB_LIBC_ARMSTDC_INCLUDE_SYS__TIMEVAL_H_ */
|
||||
|
||||
@@ -23,5 +23,6 @@ struct timeval {
|
||||
time_t tv_sec;
|
||||
suseconds_t tv_usec;
|
||||
};
|
||||
#define __timeval_defined
|
||||
|
||||
#endif /* ZEPHYR_LIB_LIBC_IAR_INCLUDE_SYS__TIMEVAL_H_ */
|
||||
|
||||
@@ -19,9 +19,13 @@ typedef _TIME_T_ time_t;
|
||||
typedef _SUSECONDS_T_ suseconds_t;
|
||||
#endif
|
||||
|
||||
#if !defined(_TIMEVAL_DECLARED) && !defined(__timeval_defined)
|
||||
struct timeval {
|
||||
time_t tv_sec;
|
||||
suseconds_t tv_usec;
|
||||
};
|
||||
#define _TIMEVAL_DECLARED
|
||||
#define __timeval_defined
|
||||
#endif
|
||||
|
||||
#endif /* ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_SYS__TIMEVAL_H_ */
|
||||
|
||||
14
lib/libc/newlib/include/sys/_timeval.h
Normal file
14
lib/libc/newlib/include/sys/_timeval.h
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright The Zephyr Project Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef ZEPHYR_LIB_LIBC_NEWLIB_INCLUDE_SYS__TIMEVAL_H_
|
||||
#define ZEPHYR_LIB_LIBC_NEWLIB_INCLUDE_SYS__TIMEVAL_H_
|
||||
|
||||
#include_next <sys/_timeval.h>
|
||||
|
||||
#define _TIMEVAL_DECLARED
|
||||
|
||||
#endif /* ZEPHYR_LIB_LIBC_NEWLIB_INCLUDE_SYS__TIMEVAL_H_ */
|
||||
14
lib/libc/picolibc/include/sys/_timeval.h
Normal file
14
lib/libc/picolibc/include/sys/_timeval.h
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright The Zephyr Project Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef ZEPHYR_LIB_LIBC_PICOLIBC_INCLUDE_SYS__TIMEVAL_H_
|
||||
#define ZEPHYR_LIB_LIBC_PICOLIBC_INCLUDE_SYS__TIMEVAL_H_
|
||||
|
||||
#include_next <sys/_timeval.h>
|
||||
|
||||
#define _TIMEVAL_DECLARED
|
||||
|
||||
#endif /* ZEPHYR_LIB_LIBC_PICOLIBC_INCLUDE_SYS__TIMEVAL_H_ */
|
||||
Reference in New Issue
Block a user