Skip to content

Commit 717c572

Browse files
committed
Change the inclusion checking
1 parent 00ada28 commit 717c572

2 files changed

Lines changed: 12 additions & 20 deletions

File tree

wolfcrypt/src/random.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3467,14 +3467,14 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
34673467
#endif
34683468
#endif
34693469

3470-
#ifndef _POSIX_C_SOURCE
3471-
#if KERNEL_VERSION_NUMBER >= 0x30100
3472-
#include <zephyr/posix/time.h>
3473-
#else
3470+
#if KERNEL_VERSION_NUMBER >= 0x30100
3471+
#include <time.h>
3472+
#else
3473+
#ifndef _POSIX_C_SOURCE
34743474
#include <posix/time.h>
3475+
#else
3476+
#include <time.h>
34753477
#endif
3476-
#else
3477-
#include <time.h>
34783478
#endif
34793479

34803480
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)

wolfssl/wolfcrypt/wc_port.h

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,22 +1539,14 @@ WOLFSSL_ABI WOLFSSL_API int wolfCrypt_Cleanup(void);
15391539
#else
15401540
#include <version.h>
15411541
#endif
1542-
#ifndef _POSIX_C_SOURCE
1543-
#if KERNEL_VERSION_NUMBER >= 0x30100
1544-
#ifdef __has_include
1545-
#if __has_include(<zephyr/posix/time.h>)
1546-
#include <zephyr/posix/time.h>
1547-
#else
1548-
#include <time.h>
1549-
#endif
1550-
#else
1551-
#include <zephyr/posix/time.h>
1552-
#endif
1553-
#else
1542+
#if KERNEL_VERSION_NUMBER >= 0x30100
1543+
#include <time.h>
1544+
#else
1545+
#ifndef _POSIX_C_SOURCE
15541546
#include <posix/time.h>
1547+
#else
1548+
#include <time.h>
15551549
#endif
1556-
#else
1557-
#include <time.h>
15581550
#endif
15591551

15601552
#ifndef CLOCK_REALTIME

0 commit comments

Comments
 (0)