Skip to content

Commit cd08869

Browse files
authored
PYBIND11_NAMESPACE consistency fixes. (#4043)
1 parent 0ab1fcf commit cd08869

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

include/pybind11/cast.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ struct always_construct_holder {
846846

847847
/// Create a specialization for custom holder types (silently ignores std::shared_ptr)
848848
#define PYBIND11_DECLARE_HOLDER_TYPE(type, holder_type, ...) \
849-
namespace pybind11 { \
849+
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) \
850850
namespace detail { \
851851
template <typename type> \
852852
struct always_construct_holder<holder_type> : always_construct_holder<void, ##__VA_ARGS__> { \
@@ -855,7 +855,7 @@ struct always_construct_holder {
855855
class type_caster<holder_type, enable_if_t<!is_shared_ptr<holder_type>::value>> \
856856
: public type_caster_holder<type, holder_type> {}; \
857857
} \
858-
}
858+
PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)
859859

860860
// PYBIND11_DECLARE_HOLDER_TYPE holder types:
861861
template <typename base, typename holder>
@@ -1650,12 +1650,12 @@ handle type::handle_of() {
16501650
}
16511651

16521652
#define PYBIND11_MAKE_OPAQUE(...) \
1653-
namespace pybind11 { \
1653+
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) \
16541654
namespace detail { \
16551655
template <> \
16561656
class type_caster<__VA_ARGS__> : public type_caster_base<__VA_ARGS__> {}; \
16571657
} \
1658-
}
1658+
PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)
16591659

16601660
/// Lets you pass a type containing a `,` through a macro parameter without needing a separate
16611661
/// typedef, e.g.:

include/pybind11/detail/init.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -425,4 +425,4 @@ struct pickle_factory<Get, Set, RetState(Self), NewInstance(ArgState)> {
425425

426426
PYBIND11_NAMESPACE_END(initimpl)
427427
PYBIND11_NAMESPACE_END(detail)
428-
PYBIND11_NAMESPACE_END(pybind11)
428+
PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)

0 commit comments

Comments
 (0)