From 9cbad804c5bb10446e8cf00db5702eb0c3df2c96 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Fri, 20 Jun 2025 09:08:32 +0800 Subject: [PATCH] Add deprecations --- lib/xy.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/xy.h b/lib/xy.h index 76831e2..9efe777 100644 --- a/lib/xy.h +++ b/lib/xy.h @@ -31,6 +31,17 @@ #include #include +#if defined(__STDC__) && __STDC_VERSION__ >= 202311 + #define XY_Dreprecate_This(msg) [[deprecated(msg)]] +#elif defined(__GNUC__) || defined(__clang__) + #define XY_Deprecate_This(msg) __attribute__((deprecated(msg))) +#elif defined(_MSC_VER) + #define XY_Deprecate_This(msg) __declspec(deprecated(msg)) +#else + #define XY_Deprecate_This(msg) +#endif + + /* Global */ bool xy_enable_color = true; @@ -74,9 +85,13 @@ bool xy_enable_color = true; #define xy_useutf8() #endif +XY_Deprecate_This("Not use anymore") void putf (double n) { printf ("%f\n", n); } +XY_Deprecate_This("Not use anymore") void puti (long long n) { printf ("%lld\n", n); } +XY_Deprecate_This("Not use anymore") void putb (bool n) { if (n) puts ("true"); else puts ("false"); } + void print (const char *s) { printf ("%s", s); } void println (const char *s) { printf ("%s\n", s); } void say (const char *s) { printf ("%s\n", s); }