Skip to content

Commit f64bc2c

Browse files
Switch to better name
1 parent ac21ed4 commit f64bc2c

17 files changed

+41
-41
lines changed

include/pybind11/cast.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
3232

33-
PYBIND11_DISABLE_WARNING_MSVC(4127)
33+
PYBIND11_WARNING_DISABLE_MSVC(4127)
3434

3535
PYBIND11_NAMESPACE_BEGIN(detail)
3636

include/pybind11/detail/common.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,27 @@
4141
#endif
4242

4343
#ifdef PYBIND11_COMPILER_MSVC
44-
# define PYBIND11_DISABLE_WARNING_MSVC(name) PYBIND11_PRAGMA(warning(disable : name))
44+
# define PYBIND11_WARNING_DISABLE_MSVC(name) PYBIND11_PRAGMA(warning(disable : name))
4545
#else
46-
# define PYBIND11_DISABLE_WARNING_MSVC(name)
46+
# define PYBIND11_WARNING_DISABLE_MSVC(name)
4747
#endif
4848

4949
#ifdef PYBIND11_COMPILER_CLANG
50-
# define PYBIND11_DISABLE_WARNING_CLANG(name) PYBIND11_PRAGMA(clang diagnostic ignored name)
50+
# define PYBIND11_WARNING_DISABLE_CLANG(name) PYBIND11_PRAGMA(clang diagnostic ignored name)
5151
#else
52-
# define PYBIND11_DISABLE_WARNING_CLANG(name)
52+
# define PYBIND11_WARNING_DISABLE_CLANG(name)
5353
#endif
5454

5555
#ifdef PYBIND11_COMPILER_GCC
56-
# define PYBIND11_DISABLE_WARNING_GCC(name) PYBIND11_PRAGMA(GCC diagnostic ignored name)
56+
# define PYBIND11_WARNING_DISABLE_GCC(name) PYBIND11_PRAGMA(GCC diagnostic ignored name)
5757
#else
58-
# define PYBIND11_DISABLE_WARNING_GCC(name)
58+
# define PYBIND11_WARNING_DISABLE_GCC(name)
5959
#endif
6060

6161
#ifdef PYBIND11_COMPILER_INTEL
62-
# define PYBIND11_DISABLE_WARNING_INTEL(name) PYBIND11_PRAGMA(warning disable name)
62+
# define PYBIND11_WARNING_DISABLE_INTEL(name) PYBIND11_PRAGMA(warning disable name)
6363
#else
64-
# define PYBIND11_DISABLE_WARNING_INTEL(name)
64+
# define PYBIND11_WARNING_DISABLE_INTEL(name)
6565
#endif
6666

6767
#define PYBIND11_NAMESPACE_BEGIN(name) \
@@ -204,7 +204,7 @@
204204
/// Include Python header, disable linking to pythonX_d.lib on Windows in debug mode
205205
#if defined(_MSC_VER)
206206
PYBIND11_WARNING_PUSH
207-
PYBIND11_DISABLE_WARNING_MSVC(4505)
207+
PYBIND11_WARNING_DISABLE_MSVC(4505)
208208
// C4505: 'PySlice_GetIndicesEx': unreferenced local function has been removed (PyPy only)
209209
# if defined(_DEBUG) && !defined(Py_DEBUG)
210210
// Workaround for a VS 2022 issue.

include/pybind11/detail/init.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
1515

16-
PYBIND11_DISABLE_WARNING_MSVC(4127)
16+
PYBIND11_WARNING_DISABLE_MSVC(4127)
1717

1818
PYBIND11_NAMESPACE_BEGIN(detail)
1919

include/pybind11/eigen/matrix.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
https://stackoverflow.com/questions/1741816/isystem-for-ms-visual-studio-c-compiler
1818
*/
1919
PYBIND11_WARNING_PUSH
20-
PYBIND11_DISABLE_WARNING_MSVC(5054) // https://github.com/pybind/pybind11/pull/3741
20+
PYBIND11_WARNING_DISABLE_MSVC(5054) // https://github.com/pybind/pybind11/pull/3741
2121
// C5054: operator '&': deprecated between enumerations of different types
22-
PYBIND11_DISABLE_WARNING_GCC("-Wmaybe-uninitialized")
22+
PYBIND11_WARNING_DISABLE_GCC("-Wmaybe-uninitialized")
2323

2424
#include <Eigen/Core>
2525
#include <Eigen/SparseCore>
@@ -34,7 +34,7 @@ static_assert(EIGEN_VERSION_AT_LEAST(3, 2, 7),
3434

3535
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
3636

37-
PYBIND11_DISABLE_WARNING_MSVC(4127)
37+
PYBIND11_WARNING_DISABLE_MSVC(4127)
3838

3939
// Provide a convenience alias for easier pass-by-ref usage with fully dynamic strides:
4040
using EigenDStride = Eigen::Stride<Eigen::Dynamic, Eigen::Dynamic>;

include/pybind11/eigen/tensor.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ static_assert(__GNUC__ > 5, "Eigen Tensor support in pybind11 requires GCC > 5.0
1515

1616
// Disable warnings for Eigen
1717
PYBIND11_WARNING_PUSH
18-
PYBIND11_DISABLE_WARNING_MSVC(4554)
19-
PYBIND11_DISABLE_WARNING_MSVC(4127)
20-
PYBIND11_DISABLE_WARNING_GCC("-Wmaybe-uninitialized")
18+
PYBIND11_WARNING_DISABLE_MSVC(4554)
19+
PYBIND11_WARNING_DISABLE_MSVC(4127)
20+
PYBIND11_WARNING_DISABLE_GCC("-Wmaybe-uninitialized")
2121

2222
#include <unsupported/Eigen/CXX11/Tensor>
2323

@@ -28,7 +28,7 @@ static_assert(EIGEN_VERSION_AT_LEAST(3, 3, 0),
2828

2929
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
3030

31-
PYBIND11_DISABLE_WARNING_MSVC(4127)
31+
PYBIND11_WARNING_DISABLE_MSVC(4127)
3232

3333
PYBIND11_NAMESPACE_BEGIN(detail)
3434

@@ -134,7 +134,7 @@ struct get_tensor_descriptor {
134134
// We need to disable the type-limits warning for the inner loop when size = 0.
135135

136136
PYBIND11_WARNING_PUSH
137-
PYBIND11_DISABLE_WARNING_GCC("-Wtype-limits")
137+
PYBIND11_WARNING_DISABLE_GCC("-Wtype-limits")
138138

139139
template <typename T, int size>
140140
std::vector<T> convert_dsizes_to_vector(const Eigen::DSizes<T, size> &arr) {

include/pybind11/numpy.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static_assert(std::is_signed<Py_intptr_t>::value, "Py_intptr_t must be signed");
3636

3737
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
3838

39-
PYBIND11_DISABLE_WARNING_MSVC(4127)
39+
PYBIND11_WARNING_DISABLE_MSVC(4127)
4040

4141
class array; // Forward declaration
4242

@@ -1870,7 +1870,7 @@ struct vectorize_helper {
18701870

18711871
PYBIND11_WARNING_PUSH
18721872
#ifdef PYBIND11_DETECTED_CLANG_WITH_MISLEADING_CALL_STD_MOVE_EXPLICITLY_WARNING
1873-
PYBIND11_DISABLE_WARNING_CLANG("-Wreturn-std-move")
1873+
PYBIND11_WARNING_DISABLE_CLANG("-Wreturn-std-move")
18741874
#endif
18751875

18761876
if (size == 0) {

include/pybind11/pybind11.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
4545
No other GCC version generates this warning.
4646
*/
4747
#if defined(__GNUC__) && __GNUC__ == 7
48-
PYBIND11_DISABLE_WARNING_GCC("-Wnoexcept-type")
48+
PYBIND11_WARNING_DISABLE_GCC("-Wnoexcept-type")
4949
#endif
5050

51-
PYBIND11_DISABLE_WARNING_MSVC(4127)
51+
PYBIND11_WARNING_DISABLE_MSVC(4127)
5252

5353
PYBIND11_NAMESPACE_BEGIN(detail)
5454

@@ -185,13 +185,13 @@ class cpp_function : public function {
185185
PYBIND11_WARNING_PUSH
186186

187187
#if defined(__GNUG__) && __GNUC__ >= 6
188-
PYBIND11_DISABLE_WARNING_GCC("-Wplacement-new")
188+
PYBIND11_WARNING_DISABLE_GCC("-Wplacement-new")
189189
#endif
190190

191191
new ((capture *) &rec->data) capture{std::forward<Func>(f)};
192192

193193
#if !PYBIND11_HAS_STD_LAUNDER
194-
PYBIND11_DISABLE_WARNING_GCC("-Wstrict-aliasing")
194+
PYBIND11_WARNING_DISABLE_GCC("-Wstrict-aliasing")
195195
#endif
196196

197197
// UB without std::launder, but without breaking ABI and/or

include/pybind11/pytypes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
3535

36-
PYBIND11_DISABLE_WARNING_MSVC(4127)
36+
PYBIND11_WARNING_DISABLE_MSVC(4127)
3737

3838
/* A few forward declarations */
3939
class handle;
@@ -887,7 +887,7 @@ object object_or_cast(T &&o);
887887
inline handle object_or_cast(PyObject *ptr) { return ptr; }
888888

889889
PYBIND11_WARNING_PUSH
890-
PYBIND11_DISABLE_WARNING_MSVC(4522) // warning C4522: multiple assignment operators specified
890+
PYBIND11_WARNING_DISABLE_MSVC(4522) // warning C4522: multiple assignment operators specified
891891
template <typename Policy>
892892
class accessor : public object_api<accessor<Policy>> {
893893
using key_type = typename Policy::key_type;

tests/test_builtin_casters.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ PYBIND11_NAMESPACE_END(pybind11)
7474

7575
TEST_SUBMODULE(builtin_casters, m) {
7676
PYBIND11_WARNING_PUSH
77-
PYBIND11_DISABLE_WARNING_MSVC(4127)
77+
PYBIND11_WARNING_DISABLE_MSVC(4127)
7878

7979
// test_simple_string
8080
m.def("string_roundtrip", [](const char *s) { return s; });

tests/test_class.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include <utility>
2424

25-
PYBIND11_DISABLE_WARNING_MSVC(4324)
25+
PYBIND11_WARNING_DISABLE_MSVC(4324)
2626
// warning C4324: structure was padded due to alignment specifier
2727

2828
// test_brace_initialization

tests/test_constants_and_functions.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ int f1(int x) noexcept { return x + 1; }
5353
int f2(int x) noexcept(true) { return x + 2; }
5454
int f3(int x) noexcept(false) { return x + 3; }
5555
PYBIND11_WARNING_PUSH
56-
PYBIND11_DISABLE_WARNING_GCC("-Wdeprecated")
57-
PYBIND11_DISABLE_WARNING_CLANG("-Wdeprecated")
56+
PYBIND11_WARNING_DISABLE_GCC("-Wdeprecated")
57+
PYBIND11_WARNING_DISABLE_CLANG("-Wdeprecated")
5858
// NOLINTNEXTLINE(modernize-use-noexcept)
5959
int f4(int x) throw() { return x + 4; } // Deprecated equivalent to noexcept(true)
6060
PYBIND11_WARNING_POP
@@ -66,8 +66,8 @@ struct C {
6666
int m5(int x) noexcept(false) { return x - 5; }
6767
int m6(int x) const noexcept(false) { return x - 6; }
6868
PYBIND11_WARNING_PUSH
69-
PYBIND11_DISABLE_WARNING_GCC("-Wdeprecated")
70-
PYBIND11_DISABLE_WARNING_CLANG("-Wdeprecated")
69+
PYBIND11_WARNING_DISABLE_GCC("-Wdeprecated")
70+
PYBIND11_WARNING_DISABLE_CLANG("-Wdeprecated")
7171
// NOLINTNEXTLINE(modernize-use-noexcept)
7272
int m7(int x) throw() { return x - 7; }
7373
// NOLINTNEXTLINE(modernize-use-noexcept)
@@ -122,7 +122,7 @@ TEST_SUBMODULE(constants_and_functions, m) {
122122
m.def("f2", f2);
123123

124124
PYBIND11_WARNING_PUSH
125-
PYBIND11_DISABLE_WARNING_INTEL(878) // incompatible exception specifications
125+
PYBIND11_WARNING_DISABLE_INTEL(878) // incompatible exception specifications
126126
m.def("f3", f3);
127127
PYBIND11_WARNING_POP
128128

tests/test_eigen_matrix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "constructor_stats.h"
1414
#include "pybind11_tests.h"
1515

16-
PYBIND11_DISABLE_WARNING_MSVC(4996)
16+
PYBIND11_WARNING_DISABLE_MSVC(4996)
1717

1818
#include <Eigen/Cholesky>
1919

tests/test_eigen_tensor.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
PYBIND11_NAMESPACE_BEGIN(PYBIND11_TEST_EIGEN_TENSOR_NAMESPACE)
1313

14-
PYBIND11_DISABLE_WARNING_MSVC(4127)
14+
PYBIND11_WARNING_DISABLE_MSVC(4127)
1515

1616
template <typename M>
1717
void reset_tensor(M &x) {

tests/test_embed/catch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
// Silence MSVC C++17 deprecation warning from Catch regarding std::uncaught_exceptions (up to
77
// catch 2.0.1; this should be fixed in the next catch release after 2.0.1).
8-
PYBIND11_DISABLE_WARNING_MSVC(4996)
8+
PYBIND11_WARNING_DISABLE_MSVC(4996)
99

1010
// Catch uses _ internally, which breaks gettext style defines
1111
#ifdef _

tests/test_embed/test_interpreter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// Silence MSVC C++17 deprecation warning from Catch regarding std::uncaught_exceptions (up to
44
// catch 2.0.1; this should be fixed in the next catch release after 2.0.1).
5-
PYBIND11_DISABLE_WARNING_MSVC(4996)
5+
PYBIND11_WARNING_DISABLE_MSVC(4996)
66

77
#include <catch.hpp>
88
#include <cstdlib>

tests/test_kwargs_and_defaults.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ TEST_SUBMODULE(kwargs_and_defaults, m) {
4747
PYBIND11_WARNING_PUSH
4848

4949
#ifdef PYBIND11_DETECTED_CLANG_WITH_MISLEADING_CALL_STD_MOVE_EXPLICITLY_WARNING
50-
PYBIND11_DISABLE_WARNING_CLANG("-Wreturn-std-move")
50+
PYBIND11_WARNING_DISABLE_CLANG("-Wreturn-std-move")
5151
#endif
5252
return args;
5353
PYBIND11_WARNING_POP

tests/test_operator_overloading.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ std::string abs(const Vector2 &) { return "abs(Vector2)"; }
139139
// TODO(eric): This could be resolved using a function / functor (e.g. `py::self()`).
140140
#if defined(__APPLE__) && defined(__clang__)
141141
# if (__clang_major__ >= 10)
142-
PYBIND11_DISABLE_WARNING_CLANG("-Wself-assign-overloaded")
142+
PYBIND11_WARNING_DISABLE_CLANG("-Wself-assign-overloaded")
143143
# endif
144144
#elif defined(__clang__)
145145
# if (__clang_major__ >= 7)
146-
PYBIND11_DISABLE_WARNING_CLANG("-Wself-assign-overloaded")
146+
PYBIND11_WARNING_DISABLE_CLANG("-Wself-assign-overloaded")
147147
# endif
148148
#endif
149149

0 commit comments

Comments
 (0)