diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2002-12-19 15:12:26 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2002-12-19 15:12:26 (GMT) |
commit | 802926482ca55342316c315ed3d20e9a2f7087b7 (patch) | |
tree | ecde25c3d5f6aa07780ad008ef11f0f35359ff1a /Include/pyport.h | |
parent | d5e1cef92f14636b4c180483d58ae21f6ef9a861 (diff) | |
download | cpython-802926482ca55342316c315ed3d20e9a2f7087b7.zip cpython-802926482ca55342316c315ed3d20e9a2f7087b7.tar.gz cpython-802926482ca55342316c315ed3d20e9a2f7087b7.tar.bz2 |
Provide mechanism to deprecate functions, types, and struct members.
It would be nice to support other compilers besides gcc.
Diffstat (limited to 'Include/pyport.h')
-rw-r--r-- | Include/pyport.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Include/pyport.h b/Include/pyport.h index 5395b10..c469261 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -310,6 +310,19 @@ extern "C" { errno = 0; \ } while(0) +/* Py_DEPRECATED(version) + * Declare a macro or function deprecated. + * Usage: + * extern int old_var Py_DEPRECATED(2.3); + * typedef int T1 Py_DEPRECATED(2.4); + * extern int x() Py_DEPRECATED(2.5); + */ +#if defined(__GNUC__) && (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1) +#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__)) +#else +#define Py_DEPRECATED(VERSION_UNUSED) +#endif + /************************************************************************** Prototypes that are missing from the standard include files on some systems (and possibly only some versions of such systems.) |