diff --git a/include/pybind11/attr.h b/include/pybind11/attr.h index bcd69a8a..25c7cb3a 100644 --- a/include/pybind11/attr.h +++ b/include/pybind11/attr.h @@ -58,7 +58,7 @@ struct metaclass { handle value; PYBIND11_DEPRECATED("py::metaclass() is no longer required. It's turned on by default now.") - metaclass() = default; + metaclass() {} /// Override pybind11's default metaclass explicit metaclass(handle value) : value(value) { } diff --git a/include/pybind11/common.h b/include/pybind11/common.h index 6df39f87..58fc205e 100644 --- a/include/pybind11/common.h +++ b/include/pybind11/common.h @@ -69,14 +69,10 @@ # define PYBIND11_NOINLINE __attribute__ ((noinline)) #endif -#if defined(PYBIND11_CPP14) +#if defined(PYBIND11_CPP14) || defined(_MSC_VER) # define PYBIND11_DEPRECATED(reason) [[deprecated(reason)]] -#elif defined(__clang__) +#else # define PYBIND11_DEPRECATED(reason) __attribute__((deprecated(reason))) -#elif defined(__GNUG__) -# define PYBIND11_DEPRECATED(reason) __attribute__((deprecated)) -#elif defined(_MSC_VER) -# define PYBIND11_DEPRECATED(reason) __declspec(deprecated) #endif #define PYBIND11_VERSION_MAJOR 2