Commit f4ceaecf authored by Adam Cozzette's avatar Adam Cozzette

Updated deprecation macros to annotate deprecated code

parent 0d1d92d3
......@@ -59,6 +59,7 @@ COPTS = select({
"-Wno-unused-function",
# Prevents ISO C++ const string assignment warnings for pyext sources.
"-Wno-write-strings",
"-Wno-deprecated-declarations",
],
})
......
......@@ -44,6 +44,7 @@
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/message.h>
#include <google/protobuf/reflection.h>
#include <google/protobuf/stubs/mutex.h>
#include <google/protobuf/reflection.h>
#include <google/protobuf/repeated_field.h>
......
......@@ -146,8 +146,15 @@
#define PROTOBUF_NAMESPACE_CLOSE \
} /* namespace protobuf */ \
} /* namespace google */
#define PROTOBUF_DEPRECATED
#define PROTOBUF_DEPRECATED_MSG(x)
#if defined(__GNUC__) || defined(__clang__)
#define PROTOBUF_DEPRECATED __attribute__((deprecated))
#define PROTOBUF_DEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
#elif defined(_MSC_VER)
#define PROTOBUF_DEPRECATED __declspec(deprecated)
#define PROTOBUF_DEPRECATED_MSG(msg) __declspec(deprecated(msg))
#endif
#define PROTOBUF_SECTION_VARIABLE(x)
#define PROTOBUF_MUST_USE_RESULT
......
......@@ -103,8 +103,9 @@
#define LIBPROTOC_EXPORT
#endif
#define PROTOBUF_RUNTIME_DEPRECATED(message)
#define GOOGLE_PROTOBUF_RUNTIME_DEPRECATED(message)
#define PROTOBUF_RUNTIME_DEPRECATED(message) PROTOBUF_DEPRECATED_MSG(message)
#define GOOGLE_PROTOBUF_RUNTIME_DEPRECATED(message) \
PROTOBUF_DEPRECATED_MSG(message)
// ===================================================================
// from google3/base/port.h
......
......@@ -157,6 +157,7 @@ class PROTOBUF_EXPORT TextFormat {
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FastFieldValuePrinter);
};
// Deprecated: please use FastFieldValuePrinter instead.
class PROTOBUF_EXPORT FieldValuePrinter {
public:
FieldValuePrinter();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment