Skip to content

Commit 89c3ed6

Browse files
committed
mark some more compat headers as IWYU export
not all compat/ headers are marked as exporting, 2 reasons: - some compat define own symbols, like platform_semafore or aligned_malloc (not _alloc as in C11) - some headers are too generic to export all symbols, eg. unistd.h or windows.h
1 parent 8896b87 commit 89c3ed6

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

src/compat/dlfunc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author Martin Pulec <[email protected]>
44
*/
55
/*
6-
* Copyright (c) 2011-2022 CESNET, z. s. p. o.
6+
* Copyright (c) 2011-2025 CESNET, zájmové sdružení právnických osob
77
* All rights reserved.
88
*
99
* Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,7 @@
4747
#define dlclose FreeLibrary
4848
EXTERN_C const char *dlerror(void);
4949
#else // ! defined _WIN32
50-
#include <dlfcn.h>
50+
#include <dlfcn.h> // IWYU pragma: export
5151
#define LIB_HANDLE void *
5252
#define FARPROC void *
5353
#endif // defined _WIN32

src/compat/endian.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
#endif
101101

102102
#else
103-
#include <endian.h>
103+
#include <endian.h> // IWYU pragma: export
104104
#endif
105105

106106
#endif // defined COMPAT_ENDIAN_H_A5D7C443_895D_465E_A46D_BF5E6DAA833F

src/compat/net.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#ifndef COMPAT_NET_H_EF7499D8_4939_4F86_A585_2EED8221D056
4242
#define COMPAT_NET_H_EF7499D8_4939_4F86_A585_2EED8221D056
4343

44+
// IWYU pragma: begin_exports
4445
#ifdef _WIN32
4546
#include <winsock2.h>
4647
typedef SOCKET fd_t;
@@ -52,5 +53,6 @@ typedef SOCKET fd_t;
5253
typedef int fd_t;
5354
#define INVALID_SOCKET (-1)
5455
#endif
56+
// IWYU pragma: end_exports
5557

5658
#endif // defined COMPAT_NET_H_EF7499D8_4939_4F86_A585_2EED8221D056

src/compat/time.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* time-related compatibility header
66
*/
77
/*
8-
* Copyright (c) 2024 CESNET
8+
* Copyright (c) 2024-2025 CESNET, zájmové sdružení právnických osob
99
* All rights reserved.
1010
*
1111
* Redistribution and use in source and binary forms, with or without
@@ -40,7 +40,7 @@
4040
#ifndef COMPAT_MISC_H_7C0E2D4B_7D55_4107_918B_7BF2BEB92428
4141
#define COMPAT_MISC_H_7C0E2D4B_7D55_4107_918B_7BF2BEB92428
4242

43-
#include <time.h>
43+
#include <time.h> // IWYU pragma: export
4444

4545
#ifndef __STDC_LIB_EXT1__
4646
#ifdef _WIN32

0 commit comments

Comments
 (0)