Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated deprecation macros to annotate deprecated code #6612

Merged
merged 1 commit into from Sep 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions BUILD
Expand Up @@ -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",
],
})

Expand Down
1 change: 1 addition & 0 deletions src/google/protobuf/dynamic_message.h
Expand Up @@ -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>
Expand Down
11 changes: 9 additions & 2 deletions src/google/protobuf/port_def.inc
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions src/google/protobuf/stubs/port.h
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/google/protobuf/text_format.h
Expand Up @@ -157,6 +157,7 @@ class PROTOBUF_EXPORT TextFormat {
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FastFieldValuePrinter);
};

// Deprecated: please use FastFieldValuePrinter instead.
class PROTOBUF_EXPORT FieldValuePrinter {
public:
FieldValuePrinter();
Expand Down