Skip to content

Commit

Permalink
Add IWYU export pragmas to protect internal headers
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 8, 2024
1 parent bbbd022 commit 08b93b5
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions include/nanobind/nanobind.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@
#include <new>

// Implementation. The nb_*.h files should only be included through nanobind.h
#include "nb_python.h"
#include "nb_defs.h"
#include "nb_enums.h"
#include "nb_traits.h"
#include "nb_tuple.h"
#include "nb_lib.h"
#include "nb_descr.h"
#include "nb_types.h"
#include "nb_accessor.h"
#include "nb_error.h"
#include "nb_attr.h"
#include "nb_cast.h"
#include "nb_misc.h"
#include "nb_call.h"
#include "nb_func.h"
#include "nb_class.h"
#include "nb_python.h" // IWYU pragma: export
#include "nb_defs.h" // IWYU pragma: export
#include "nb_enums.h" // IWYU pragma: export
#include "nb_traits.h" // IWYU pragma: export
#include "nb_tuple.h" // IWYU pragma: export
#include "nb_lib.h" // IWYU pragma: export
#include "nb_descr.h" // IWYU pragma: export
#include "nb_types.h" // IWYU pragma: export
#include "nb_accessor.h" // IWYU pragma: export
#include "nb_error.h" // IWYU pragma: export
#include "nb_attr.h" // IWYU pragma: export
#include "nb_cast.h" // IWYU pragma: export
#include "nb_misc.h" // IWYU pragma: export
#include "nb_call.h" // IWYU pragma: export
#include "nb_func.h" // IWYU pragma: export
#include "nb_class.h" // IWYU pragma: export

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

0 comments on commit 08b93b5

Please sign in to comment.