Last active
May 11, 2020 22:11
-
-
Save rotu/d65b382ef424e97df93d68e7f73d5c0c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Foo1 { | |
Bar1=1, | |
Baz1 | |
#ifdef _MSC_VER | |
#pragma deprecated(Baz1) | |
#else | |
__attribute__ ((deprecated("Use something else"))) | |
#endif | |
= 2, | |
Bang1=3, | |
}; | |
#ifdef _MSC_VER | |
#define DECLARE_DEPRECATED(name, msg) name __pragma(deprecated(name)) | |
#else | |
#define DECLARE_DEPRECATED(name, msg) name __attribute__((deprecated(msg))) | |
#endif | |
enum Foo2 { | |
Bar2=1, | |
DECLARE_DEPRECATED(Baz2, "Use something else") = 2, | |
Bang2=3, | |
}; | |
int main(){ | |
enum Foo1 bar1 = Bar1; | |
enum Foo1 baz1 = Baz1; | |
enum Foo2 bar2 = Bar2; | |
enum Foo2 baz2 = Baz2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tested to work in gcc, clang, and visual studio