Skip to content

Commit

Permalink
Introduce RETRO_DEPRECATED macro (libretro#15363)
Browse files Browse the repository at this point in the history
  • Loading branch information
Grisly Glee authored Jun 15, 2023
1 parent 0b7e8ea commit 3861e6e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions libretro-common/include/retro_common_api.h
Original file line number Diff line number Diff line change
@@ -101,6 +101,26 @@ typedef int ssize_t;
#define STRING_REP_UINT64 "%" PRIu64
#define STRING_REP_USIZE "%" PRIuPTR

/* Wrap a declaration in RETRO_DEPRECATED() to produce a compiler warning when
it's used. This is intended for developer machines, so it won't work on ancient
or obscure compilers */
#if defined(_MSC_VER)
#if _MSC_VER >= 1400 /* Visual C 2005 or later */
#define RETRO_DEPRECATED(decl) __declspec(deprecated) decl
#endif
#elif defined(__GNUC__)
#if __GNUC__ >= 3 /* GCC 3 or later */
#define RETRO_DEPRECATED(decl) decl __attribute__((deprecated))
#endif
#elif defined(__clang__)
#if __clang_major__ >= 3 /* clang 3 or later */
#define RETRO_DEPRECATED(decl) decl __attribute__((deprecated))
#endif
#endif
#ifndef RETRO_DEPRECATED /* Unsupported compilers */
#define RETRO_DEPRECATED(decl) decl
#endif

/*
I would like to see retro_inline.h moved in here; possibly boolean too.

0 comments on commit 3861e6e

Please sign in to comment.