From b2f52225fa3dd546ea8475eeee397d5c1342a32a Mon Sep 17 00:00:00 2001 From: Boris Staletic Date: Fri, 10 Jul 2020 16:31:03 +0200 Subject: [PATCH] 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 --- include/pybind11/embed.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/pybind11/embed.h b/include/pybind11/embed.h index 3258e1576..eae86c714 100644 --- a/include/pybind11/embed.h +++ b/include/pybind11/embed.h @@ -61,7 +61,8 @@ } \ } \ 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)); \ void PYBIND11_CONCAT(pybind11_init_, name)(pybind11::module &variable)