Skip to content

Commit

Permalink
Googletest export
Browse files Browse the repository at this point in the history
Adding GTEST_INTERNAL_DEPRECATED ability to mark deprecated

PiperOrigin-RevId: 219515184
  • Loading branch information
gennadiycivil committed Nov 1, 2018
1 parent 879ac09 commit 88c15b5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions googletest/include/gtest/internal/gtest-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1423,4 +1423,19 @@ class FlatTuple
test_case_name, test_name)>); \
void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()

// Internal Macro to mark an API deprecated, for googletest usage only
// Usage: class GTEST_INTERNAL_DEPRECATED(message) MyClass or
// GTEST_INTERNAL_DEPRECATED(message) <return_type> myFunction(); Every usage of
// a deprecated entity will trigger a warning when compiled with
// `-Wdeprecated-declarations` option (clang, gcc, any __GNUC__ compiler).
// For msvc /W3 option will need to be used
// Note that for 'other' compilers this macro evaluates to nothing to prevent
// compilations errors.
#if defined(_MSC_VER)
#define GTEST_INTERNAL_DEPRECATED(message) __declspec(deprecated(message))
#elif defined(__GNUC__)
#define GTEST_INTERNAL_DEPRECATED(message) __attribute__((deprecated(message)))
#else
#define GTEST_INTERNAL_DEPRECATED(message)
#endif
#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_

0 comments on commit 88c15b5

Please sign in to comment.