Skip to content

Commit

Permalink
utils: Add an error if platform detection failed
Browse files Browse the repository at this point in the history
Signed-off-by: Siddharth Chandrasekaran <[email protected]>
  • Loading branch information
sidcha committed Jun 1, 2024
1 parent d295048 commit 3f343bc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ int add_iso8601_utc_datetime(char* buf, size_t size)
return r;
}

#else /* WINDOWS */
#elif defined(__linux__) || defined(__APPLE__)

#include <sys/time.h>
#include <time.h>
Expand All @@ -148,7 +148,11 @@ int add_iso8601_utc_datetime(char *buf, size_t size)
return strftime(buf, size, "%Y-%m-%dT%H:%M:%SZ", &timeinfo);
}

#endif /* WINDOWS */
#else

#error Platform test failed

#endif

int64_t usec_now()
{
Expand Down

0 comments on commit 3f343bc

Please sign in to comment.