Skip to content

Commit 23f3ef0

Browse files
committed
Use PYBIND11_WARNING macros
1 parent a3bf977 commit 23f3ef0

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

include/pybind11/detail/class.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,12 +499,12 @@ extern "C" inline void pybind11_object_dealloc(PyObject *self) {
499499
Py_DECREF(type);
500500
}
501501

502-
#pragma GCC diagnostic push
503-
#pragma GCC diagnostic ignored "-Wredundant-decls"
502+
PYBIND11_WARNING_PUSH
503+
PYBIND11_WARNING_DISABLE_GCC("-Wredundant-decls")
504504

505505
std::string error_string();
506506

507-
#pragma GCC diagnostic pop
507+
PYBIND11_WARNING_POP
508508

509509
/** Create the type which can be used as a common base for all classes. This is
510510
needed in order to satisfy Python's requirements for multiple inheritance.

include/pybind11/gil.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
3232

3333
PYBIND11_NAMESPACE_BEGIN(detail)
3434

35-
#pragma GCC diagnostic push
36-
#pragma GCC diagnostic ignored "-Wredundant-decls"
35+
PYBIND11_WARNING_PUSH
36+
PYBIND11_WARNING_DISABLE_GCC("-Wredundant-decls")
3737

3838
// forward declarations
3939
PyThreadState *get_thread_state_unchecked();
4040

41-
#pragma GCC diagnostic pop
41+
PYBIND11_WARNING_POP
4242

4343
PYBIND11_NAMESPACE_END(detail)
4444

0 commit comments

Comments
 (0)