Merge pull request #14540 from mjbogusz/fix-clang-timeval

Improve condition for declaring `struct timeval`
pull/14569/head
Martin Kojtal 2021-04-28 12:33:13 +01:00 committed by GitHub
commit a32a45c02d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -32,8 +32,13 @@ extern "C" {
* @{
*/
/* Timeval definition for non GCC_ARM toolchains */
#if !defined(__GNUC__) || defined(__clang__)
/* Timeval definition for non GCC_ARM toolchains,
* Note: The GNU libc defines _TIMEVAL_DEFINED and the newlib defines __timeval_defined,
* thus the double-check and double-define
*/
#if !defined(__timeval_defined) && !defined(_TIMEVAL_DEFINED)
#define __timeval_defined 1
#define _TIMEVAL_DEFINED
struct timeval {
time_t tv_sec;
int32_t tv_usec;