]> granicus.if.org Git - python/commitdiff
Provide mechanism to deprecate functions, types, and struct members.
authorNeal Norwitz <nnorwitz@gmail.com>
Thu, 19 Dec 2002 15:12:26 +0000 (15:12 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Thu, 19 Dec 2002 15:12:26 +0000 (15:12 +0000)
It would be nice to support other compilers besides gcc.

Include/pyport.h

index 5395b1095be9c547a6d527b33a471dd4af0aae1c..c4692613d66a5cf8f53ffaf9bc868d5fb1f1c2c4 100644 (file)
@@ -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.)