From f348d539f9622d1c6dd7b7f0e88660d867f4271f Mon Sep 17 00:00:00 2001 From: Boris Staletic Date: Tue, 7 Jul 2020 14:31:54 +0200 Subject: [PATCH] Rename embedded_module object's name 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 f814c783e7..9d5fa418e8 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)