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:
Robert Edmonds 2014-06-06 14:55:11 -04:00
parent d05795c335
commit 8655ca076d
3 changed files with 6 additions and 6 deletions

View File

@ -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)

View File

@ -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",

View File

@ -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 "";
}