Skip to content

Commit

Permalink
Add IWYU export pragmas to protect internal headers (#756)
Browse files Browse the repository at this point in the history
Include What You Use tries to add the internal nanobind headers to files using nanobind.h. Tell it that it should rely on nanobind.h to export all of the internal symbols using the `export` pragma.
https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md#iwyu-pragma-export
  • Loading branch information
adzenith authored Oct 16, 2024
1 parent bbbd022 commit 95ae0a2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/nanobind/nanobind.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <new>

// Implementation. The nb_*.h files should only be included through nanobind.h
// IWYU pragma: begin_exports
#include "nb_python.h"
#include "nb_defs.h"
#include "nb_enums.h"
Expand All @@ -52,6 +53,7 @@
#include "nb_call.h"
#include "nb_func.h"
#include "nb_class.h"
// IWYU pragma: end_exports

#if defined(_MSC_VER)
# pragma warning(pop)
Expand Down

0 comments on commit 95ae0a2

Please sign in to comment.