-
-
Save lazka/4749c74249a3918a059d944040aca4a3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#ifdef __GNUC__ | |
#define G_GNUC_CHECK_VERSION(major, minor) \ | |
((__GNUC__ > (major)) || \ | |
((__GNUC__ == (major)) && \ | |
(__GNUC_MINOR__ >= (minor)))) | |
#else | |
#define G_GNUC_CHECK_VERSION(major, minor) 0 | |
#endif | |
#define G_STRINGIFY(macro_or_string) G_STRINGIFY_ARG (macro_or_string) | |
#define G_STRINGIFY_ARG(contents) #contents | |
#if (G_GNUC_CHECK_VERSION(4, 6) || \ | |
__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4)) | |
#define _GLIB_GNUC_DO_PRAGMA(x) _Pragma(G_STRINGIFY (x)) | |
#define GLIB_DEPRECATED_MACRO _GLIB_GNUC_DO_PRAGMA(GCC warning "Deprecated pre-processor symbol") | |
#define GLIB_DEPRECATED_MACRO_FOR(f) \ | |
_GLIB_GNUC_DO_PRAGMA(GCC warning G_STRINGIFY (Deprecated pre-processor symbol: replace with #f)) | |
#else | |
#define GLIB_DEPRECATED_MACRO | |
#define GLIB_DEPRECATED_MACRO_FOR(f) | |
#endif | |
#define PySomethingDeprecated(op) (op) GLIB_DEPRECATED_MACRO | |
#define PySomethingDeprecated2(op) (op) GLIB_DEPRECATED_MACRO_FOR(SomethingCompletelyDifferent) | |
int main(void) | |
{ | |
PySomethingDeprecated (0); | |
PySomethingDeprecated2 (42); | |
return 0; | |
} |
Author
lazka
commented
Feb 11, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment