mirror of
https://github.com/protobuf-c/protobuf-c.git
synced 2025-01-14 09:17:55 +08:00
PROTOBUF_C_{NO_,}DEPRECATED -> PROTOBUF_C__{NO_,}DEPRECATED
these identifiers aren't intended for use by client code. add a double underscore to indicate this.
This commit is contained in:
parent
d05795c335
commit
8655ca076d
@ -45,12 +45,12 @@
|
||||
# define PROTOBUF_C__END_DECLS
|
||||
#endif
|
||||
|
||||
#if !defined(PROTOBUF_C_NO_DEPRECATED)
|
||||
#if !defined(PROTOBUF_C__NO_DEPRECATED)
|
||||
# if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
|
||||
# define PROTOBUF_C_DEPRECATED __attribute__((__deprecated__))
|
||||
# define PROTOBUF_C__DEPRECATED __attribute__((__deprecated__))
|
||||
# endif
|
||||
#else
|
||||
# define PROTOBUF_C_DEPRECATED
|
||||
# define PROTOBUF_C__DEPRECATED
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && defined(PROTOBUF_C_USE_SHARED_LIB)
|
||||
|
@ -225,8 +225,8 @@ void FileGenerator::GenerateSource(io::Printer* printer) {
|
||||
"/* Generated from: $filename$ */\n"
|
||||
"\n"
|
||||
"/* Do not generate deprecated warnings for self */\n"
|
||||
"#ifndef PROTOBUF_C_NO_DEPRECATED\n"
|
||||
"#define PROTOBUF_C_NO_DEPRECATED\n"
|
||||
"#ifndef PROTOBUF_C__NO_DEPRECATED\n"
|
||||
"#define PROTOBUF_C__NO_DEPRECATED\n"
|
||||
"#endif\n"
|
||||
"\n"
|
||||
"#include \"$basename$.pb-c.h\"\n",
|
||||
|
@ -288,7 +288,7 @@ string FieldName(const FieldDescriptor* field) {
|
||||
|
||||
string FieldDeprecated(const FieldDescriptor* field) {
|
||||
if (field->options().deprecated()) {
|
||||
return " PROTOBUF_C_DEPRECATED";
|
||||
return " PROTOBUF_C__DEPRECATED";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user