|
310 | 310 | #else |
311 | 311 | #include <version.h> |
312 | 312 | #endif |
| 313 | + /* Include sys/types.h early so host libc sets __timer_t_defined |
| 314 | + * before Zephyr's posix_types.h can define a conflicting timer_t */ |
| 315 | + #include <sys/types.h> |
313 | 316 | #ifndef SINGLE_THREADED |
314 | 317 | #if !defined(CONFIG_PTHREAD_IPC) && !defined(CONFIG_POSIX_THREADS) |
315 | 318 | #error "Threading needs CONFIG_PTHREAD_IPC / CONFIG_POSIX_THREADS" |
316 | 319 | #endif |
317 | 320 | #if KERNEL_VERSION_NUMBER >= 0x30100 |
318 | 321 | #include <zephyr/kernel.h> |
319 | 322 | #ifndef CONFIG_ARCH_POSIX |
320 | | - #ifdef __has_include |
321 | | - #if __has_include(<zephyr/posix/posix_types.h>) |
322 | | - #include <zephyr/posix/posix_types.h> |
323 | | - #else |
324 | | - #include <sys/types.h> |
325 | | - #endif |
326 | | - #if __has_include(<zephyr/posix/pthread.h>) |
327 | | - #include <zephyr/posix/pthread.h> |
328 | | - #else |
329 | | - #include <pthread.h> |
330 | | - #endif |
331 | | - #else |
332 | | - #include <zephyr/posix/posix_types.h> |
333 | | - #include <zephyr/posix/pthread.h> |
334 | | - #endif |
| 323 | + #include <zephyr/posix/posix_types.h> |
| 324 | + #include <zephyr/posix/pthread.h> |
335 | 325 | #endif |
336 | 326 | #else |
337 | 327 | #include <kernel.h> |
@@ -1530,31 +1520,12 @@ WOLFSSL_ABI WOLFSSL_API int wolfCrypt_Cleanup(void); |
1530 | 1520 | } /* extern "C" */ |
1531 | 1521 | #endif |
1532 | 1522 |
|
1533 | | - #ifdef __has_include |
1534 | | - #if __has_include(<zephyr/version.h>) |
1535 | | - #include <zephyr/version.h> |
1536 | | - #else |
1537 | | - #include <version.h> |
1538 | | - #endif |
1539 | | - #else |
1540 | | - #include <version.h> |
1541 | | - #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 |
1554 | | - #include <posix/time.h> |
1555 | | - #endif |
1556 | | - #else |
| 1523 | + #if KERNEL_VERSION_NUMBER >= 0x40300 |
1557 | 1524 | #include <time.h> |
| 1525 | + #elif KERNEL_VERSION_NUMBER >= 0x30100 |
| 1526 | + #include <zephyr/posix/time.h> |
| 1527 | + #else |
| 1528 | + #include <posix/time.h> |
1558 | 1529 | #endif |
1559 | 1530 |
|
1560 | 1531 | #ifndef CLOCK_REALTIME |
|
0 commit comments