Skip to content

Commit

Permalink
fix: support deprecated enums for GCC < 6
Browse files Browse the repository at this point in the history
  • Loading branch information
coryan authored and acozzette committed Dec 28, 2020
1 parent 36aff6a commit 54d9f6a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/google/protobuf/port_def.inc
Expand Up @@ -165,10 +165,18 @@
} /* namespace protobuf */ \
} /* namespace google */

#if defined(__GNUC__) || defined(__clang__)
#if defined(__clang__)
#define PROTOBUF_DEPRECATED __attribute__((deprecated))
#define PROTOBUF_DEPRECATED_ENUM __attribute__((deprecated))
#define PROTOBUF_DEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
#elif defined(__GNUC__)
# define PROTOBUF_DEPRECATED __attribute__((deprecated))
# define PROTOBUF_DEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
# if __GNUC__ >= 6
# define PROTOBUF_DEPRECATED_ENUM __attribute__((deprecated))
# else
# define PROTOBUF_DEPRECATED_ENUM
# endif
#elif defined(_MSC_VER)
#define PROTOBUF_DEPRECATED __declspec(deprecated)
#define PROTOBUF_DEPRECATED_ENUM
Expand Down

0 comments on commit 54d9f6a

Please sign in to comment.