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
This commit is contained in:
Boris Staletic 2020-07-10 16:31:03 +02:00 committed by GitHub
parent 964ab956e0
commit b2f52225fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,7 +61,8 @@
} \ } \
} \ } \
PYBIND11_EMBEDDED_MODULE_IMPL(name) \ PYBIND11_EMBEDDED_MODULE_IMPL(name) \
pybind11::detail::embedded_module name(PYBIND11_TOSTRING(name), \ pybind11::detail::embedded_module PYBIND11_CONCAT(pybind11_module_, name) \
(PYBIND11_TOSTRING(name), \
PYBIND11_CONCAT(pybind11_init_impl_, name)); \ PYBIND11_CONCAT(pybind11_init_impl_, name)); \
void PYBIND11_CONCAT(pybind11_init_, name)(pybind11::module &variable) void PYBIND11_CONCAT(pybind11_init_, name)(pybind11::module &variable)