summaryrefslogtreecommitdiffstats
path: root/Include/warnings.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/warnings.h')
-rw-r--r--Include/warnings.h28
1 files changed, 21 insertions, 7 deletions
diff --git a/Include/warnings.h b/Include/warnings.h
index 0818d7a..b7db681 100644
--- a/Include/warnings.h
+++ b/Include/warnings.h
@@ -4,17 +4,31 @@
extern "C" {
#endif
-PyAPI_FUNC(void) _PyWarnings_Init(void);
-
-PyAPI_FUNC(int) PyErr_WarnEx(PyObject *, const char *, Py_ssize_t);
-PyAPI_FUNC(int) PyErr_WarnExplicit(PyObject *, const char *, const char *, int,
- const char *, PyObject *);
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(PyObject*) _PyWarnings_Init(void);
+#endif
-#define PyErr_WarnPy3k(msg, stacklevel) \
- (Py_Py3kWarningFlag ? PyErr_WarnEx(PyExc_DeprecationWarning, msg, stacklevel) : 0)
+PyAPI_FUNC(int) PyErr_WarnEx(
+ PyObject *category,
+ const char *message, /* UTF-8 encoded string */
+ Py_ssize_t stack_level);
+PyAPI_FUNC(int) PyErr_WarnFormat(
+ PyObject *category,
+ Py_ssize_t stack_level,
+ const char *format, /* ASCII-encoded string */
+ ...);
+PyAPI_FUNC(int) PyErr_WarnExplicit(
+ PyObject *category,
+ const char *message, /* UTF-8 encoded string */
+ const char *filename, /* decoded from the filesystem encoding */
+ int lineno,
+ const char *module, /* UTF-8 encoded string */
+ PyObject *registry);
/* DEPRECATED: Use PyErr_WarnEx() instead. */
+#ifndef Py_LIMITED_API
#define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1)
+#endif
#ifdef __cplusplus
}