Skip to content

Commit b2f5222

Browse files
authored
Rename embedded_module object's name (#2282)
This avoids a potential conflict with names in the same scope of the same name as the embedded module, like namespaces or other global variables. Fixes #2172
1 parent 964ab95 commit b2f5222

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/pybind11/embed.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
} \
6262
} \
6363
PYBIND11_EMBEDDED_MODULE_IMPL(name) \
64-
pybind11::detail::embedded_module name(PYBIND11_TOSTRING(name), \
64+
pybind11::detail::embedded_module PYBIND11_CONCAT(pybind11_module_, name) \
65+
(PYBIND11_TOSTRING(name), \
6566
PYBIND11_CONCAT(pybind11_init_impl_, name)); \
6667
void PYBIND11_CONCAT(pybind11_init_, name)(pybind11::module &variable)
6768

0 commit comments

Comments
 (0)