Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve condition for declaring struct timeval #14540

Merged
merged 1 commit into from
Apr 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions platform/include/platform/mbed_rtc_time.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down