Skip to content

Commit 00c63cf

Browse files
committed
Change postion of sys/types.h
1 parent 717c572 commit 00c63cf

3 files changed

Lines changed: 23 additions & 15 deletions

File tree

.wolfssl_known_macro_extras

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,11 +1098,8 @@ __clang_major__
10981098
__cplusplus
10991099
__ghc__
11001100
__ghs__
1101-
<<<<<<< HEAD
11021101
__has_attribute
1103-
=======
11041102
__has_include
1105-
>>>>>>> 9188ee19b (Add to macro list)
11061103
__hpux__
11071104
__i386
11081105
__i386__

wolfcrypt/src/random.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3457,6 +3457,8 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
34573457
#include <version.h>
34583458
#endif
34593459

3460+
#include <sys/types.h>
3461+
34603462
#if KERNEL_VERSION_NUMBER >= 0x30500
34613463
#include <zephyr/random/random.h>
34623464
#else
@@ -3467,14 +3469,14 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
34673469
#endif
34683470
#endif
34693471

3470-
#if KERNEL_VERSION_NUMBER >= 0x30100
3471-
#include <time.h>
3472-
#else
3473-
#ifndef _POSIX_C_SOURCE
3474-
#include <posix/time.h>
3472+
#ifndef _POSIX_C_SOURCE
3473+
#if KERNEL_VERSION_NUMBER >= 0x30100
3474+
#include <zephyr/posix/time.h>
34753475
#else
3476-
#include <time.h>
3476+
#include <posix/time.h>
34773477
#endif
3478+
#else
3479+
#include <time.h>
34783480
#endif
34793481

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

wolfssl/wolfcrypt/wc_port.h

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

15521561
#ifndef CLOCK_REALTIME

0 commit comments

Comments
 (0)