mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 06:35:12 +00:00
[common.h] Mark another entry point as "unused".
For rationale, see #2241, eeb1044818af5b70761deae602c49eba439164dc; there is a second entry point function defined by the PYBIND11_MODULE macro that also needs to be annotated as unused.
This commit is contained in:
parent
c776e9ef93
commit
1e14930dfc
@ -185,9 +185,10 @@
|
||||
#define PYBIND11_STR_TYPE ::pybind11::str
|
||||
#define PYBIND11_BOOL_ATTR "__bool__"
|
||||
#define PYBIND11_NB_BOOL(ptr) ((ptr)->nb_bool)
|
||||
// Providing a separate declaration to make Clang's -Wmissing-prototypes happy
|
||||
// Providing a separate declaration to make Clang's -Wmissing-prototypes happy.
|
||||
// See comment for PYBIND11_MODULE below for why this is marked "maybe unused".
|
||||
#define PYBIND11_PLUGIN_IMPL(name) \
|
||||
extern "C" PYBIND11_EXPORT PyObject *PyInit_##name(); \
|
||||
extern "C" PYBIND11_MAYBE_UNUSED PYBIND11_EXPORT PyObject *PyInit_##name(); \
|
||||
extern "C" PYBIND11_EXPORT PyObject *PyInit_##name()
|
||||
|
||||
#else
|
||||
@ -211,10 +212,11 @@
|
||||
#define PYBIND11_STR_TYPE ::pybind11::bytes
|
||||
#define PYBIND11_BOOL_ATTR "__nonzero__"
|
||||
#define PYBIND11_NB_BOOL(ptr) ((ptr)->nb_nonzero)
|
||||
// Providing a separate PyInit decl to make Clang's -Wmissing-prototypes happy
|
||||
// Providing a separate PyInit decl to make Clang's -Wmissing-prototypes happy.
|
||||
// See comment for PYBIND11_MODULE below for why this is marked "maybe unused".
|
||||
#define PYBIND11_PLUGIN_IMPL(name) \
|
||||
static PyObject *pybind11_init_wrapper(); \
|
||||
extern "C" PYBIND11_EXPORT void init##name(); \
|
||||
extern "C" PYBIND11_MAYBE_UNUSED PYBIND11_EXPORT void init##name(); \
|
||||
extern "C" PYBIND11_EXPORT void init##name() { \
|
||||
(void)pybind11_init_wrapper(); \
|
||||
} \
|
||||
|
Loading…
Reference in New Issue
Block a user