Skip to content

Commit

Permalink
Only define timeval and timezone for __BARE_METAL__ targets if they a…
Browse files Browse the repository at this point in the history
…re not already defined
  • Loading branch information
Sympatron committed Nov 11, 2024
1 parent 795088a commit 8386068
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,19 @@ int add_iso8601_utc_datetime(char *buf, size_t size)

#elif defined(__BARE_METAL__)

#ifndef _TIMEVAL_DEFINED
struct timeval {
long tv_sec; // seconds since epoch
long tv_usec; // microseconds
};
#endif

#ifndef _TIMEZONE_DEFINED
struct timezone {
int tz_minuteswest; // minutes west of UTC
int tz_dsttime; // daylight saving time flag
};
#endif

int gettimeofday(struct timeval * tp, struct timezone * tzp)
{
Expand Down

0 comments on commit 8386068

Please sign in to comment.