|
| 1 | +diff --git a/include/pqxx/internal/header-pre.hxx b/include/pqxx/internal/header-pre.hxx |
| 2 | +index 833d583..21b7400 100644 |
| 3 | +--- a/include/pqxx/internal/header-pre.hxx |
| 4 | ++++ b/include/pqxx/internal/header-pre.hxx |
| 5 | +@@ -101,6 +101,11 @@ |
| 6 | + // Workarounds for Microsoft Visual C++ |
| 7 | + # ifdef _MSC_VER |
| 8 | + |
| 9 | ++// Workarounds for deprecated attribute syntax error in Visual Studio 2017. |
| 10 | ++# if _MSC_VER < 1920 |
| 11 | ++# define PQXX_DEPRECATED(MESSAGE) __declspec(deprecated( #MESSAGE )) |
| 12 | ++# endif |
| 13 | ++ |
| 14 | + // Suppress vtables on abstract classes. |
| 15 | + # define PQXX_NOVTABLE __declspec(novtable) |
| 16 | + |
| 17 | +@@ -170,6 +175,10 @@ |
| 18 | + # define PQXX_NOVTABLE /* novtable */ |
| 19 | + #endif |
| 20 | + |
| 21 | ++#ifndef PQXX_DEPRECATED |
| 22 | ++# define PQXX_DEPRECATED(MESSAGE) [[deprecated( #MESSAGE )]] |
| 23 | ++#endif |
| 24 | ++ |
| 25 | + // C++20: Assume support. |
| 26 | + #if defined(PQXX_HAVE_LIKELY) |
| 27 | + # define PQXX_LIKELY [[likely]] |
| 28 | +diff --git a/include/pqxx/stream_from.hxx b/include/pqxx/stream_from.hxx |
| 29 | +index b275a7f..c63a80f 100644 |
| 30 | +--- a/include/pqxx/stream_from.hxx |
| 31 | ++++ b/include/pqxx/stream_from.hxx |
| 32 | +@@ -160,7 +160,7 @@ public: |
| 33 | + /** @deprecated Use factories @ref table or @ref raw_table instead. |
| 34 | + */ |
| 35 | + template<typename Iter> |
| 36 | +- [[deprecated("Use transaction_base::stream instead.")]] stream_from( |
| 37 | ++ PQXX_DEPRECATED("Use transaction_base::stream instead.") stream_from( |
| 38 | + transaction_base &, from_table_t, std::string_view table, |
| 39 | + Iter columns_begin, Iter columns_end); |
| 40 | + |
| 41 | +@@ -168,13 +168,13 @@ public: |
| 42 | + /** @deprecated Use factory function @ref query instead. |
| 43 | + */ |
| 44 | + template<typename Columns> |
| 45 | +- [[deprecated("Use transaction_base::stream() instead.")]] stream_from( |
| 46 | ++ PQXX_DEPRECATED("Use transaction_base::stream() instead.") stream_from( |
| 47 | + transaction_base &tx, from_table_t, std::string_view table, |
| 48 | + Columns const &columns); |
| 49 | + |
| 50 | + #include "pqxx/internal/ignore-deprecated-pre.hxx" |
| 51 | + /// @deprecated Use factories @ref table or @ref raw_table instead. |
| 52 | +- [[deprecated("Use transaction_base::stream instead.")]] stream_from( |
| 53 | ++ PQXX_DEPRECATED("Use transaction_base::stream instead.") stream_from( |
| 54 | + transaction_base &tx, std::string_view table) : |
| 55 | + stream_from{tx, from_table, table} |
| 56 | + {} |
| 57 | +@@ -182,14 +182,14 @@ public: |
| 58 | + |
| 59 | + /// @deprecated Use factories @ref table or @ref raw_table instead. |
| 60 | + template<typename Columns> |
| 61 | +- [[deprecated("Use transaction_base::stream instead.")]] stream_from( |
| 62 | ++ PQXX_DEPRECATED("Use transaction_base::stream instead.") stream_from( |
| 63 | + transaction_base &tx, std::string_view table, Columns const &columns) : |
| 64 | + stream_from{tx, from_table, table, columns} |
| 65 | + {} |
| 66 | + |
| 67 | + /// @deprecated Use factories @ref table or @ref raw_table instead. |
| 68 | + template<typename Iter> |
| 69 | +- [[deprecated("Use transaction_base::stream instead.")]] stream_from( |
| 70 | ++ PQXX_DEPRECATED("Use transaction_base::stream instead.") stream_from( |
| 71 | + transaction_base &, std::string_view table, Iter columns_begin, |
| 72 | + Iter columns_end); |
| 73 | + |
| 74 | +diff --git a/include/pqxx/stream_to.hxx b/include/pqxx/stream_to.hxx |
| 75 | +index 281af28..838003d 100644 |
| 76 | +--- a/include/pqxx/stream_to.hxx |
| 77 | ++++ b/include/pqxx/stream_to.hxx |
| 78 | +@@ -248,7 +248,7 @@ public: |
| 79 | + * your data fields and the table is explicit in your code, and not hidden |
| 80 | + * in an "implicit contract" between your code and your schema. |
| 81 | + */ |
| 82 | +- [[deprecated("Use table() or raw_table() factory.")]] stream_to( |
| 83 | ++ PQXX_DEPRECATED("Use table() or raw_table() factory.") stream_to( |
| 84 | + transaction_base &tx, std::string_view table_name) : |
| 85 | + stream_to{tx, table_name, ""sv} |
| 86 | + {} |
| 87 | +@@ -257,7 +257,7 @@ public: |
| 88 | + /** @deprecated Use @ref table or @ref raw_table as a factory. |
| 89 | + */ |
| 90 | + template<typename Columns> |
| 91 | +- [[deprecated("Use table() or raw_table() factory.")]] stream_to( |
| 92 | ++ PQXX_DEPRECATED("Use table() or raw_table() factory.") stream_to( |
| 93 | + transaction_base &, std::string_view table_name, Columns const &columns); |
| 94 | + |
| 95 | + private: |
0 commit comments