Kaydet (Commit) 1c0689c6 authored tarafından Martin v. Löwis's avatar Martin v. Löwis

Issue #19526: Exclude all new API from the stable ABI.

üst a2924cab
...@@ -409,8 +409,8 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ ...@@ -409,8 +409,8 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
#ifndef Py_LIMITED_API #ifndef Py_LIMITED_API
PyAPI_FUNC(int) _PyObject_HasLen(PyObject *o); PyAPI_FUNC(int) _PyObject_HasLen(PyObject *o);
PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t);
#endif #endif
PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t);
/* /*
Guess the size of object o using len(o) or o.__length_hint__(). Guess the size of object o using len(o) or o.__length_hint__().
......
...@@ -94,7 +94,7 @@ PyAPI_FUNC(PyObject *) PyCodec_Decode( ...@@ -94,7 +94,7 @@ PyAPI_FUNC(PyObject *) PyCodec_Decode(
const char *errors const char *errors
); );
#ifndef PY_LIMITED_API #ifndef Py_LIMITED_API
/* Text codec specific encoding and decoding API. /* Text codec specific encoding and decoding API.
Checks the encoding against a list of codecs which do not Checks the encoding against a list of codecs which do not
......
...@@ -53,8 +53,10 @@ PyAPI_FUNC(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key); ...@@ -53,8 +53,10 @@ PyAPI_FUNC(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key);
PyAPI_FUNC(PyObject *) PyDict_GetItemWithError(PyObject *mp, PyObject *key); PyAPI_FUNC(PyObject *) PyDict_GetItemWithError(PyObject *mp, PyObject *key);
PyAPI_FUNC(PyObject *) _PyDict_GetItemIdWithError(PyObject *dp, PyAPI_FUNC(PyObject *) _PyDict_GetItemIdWithError(PyObject *dp,
struct _Py_Identifier *key); struct _Py_Identifier *key);
#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyDict_SetDefault( PyAPI_FUNC(PyObject *) PyDict_SetDefault(
PyObject *mp, PyObject *key, PyObject *defaultobj); PyObject *mp, PyObject *key, PyObject *defaultobj);
#endif
PyAPI_FUNC(int) PyDict_SetItem(PyObject *mp, PyObject *key, PyObject *item); PyAPI_FUNC(int) PyDict_SetItem(PyObject *mp, PyObject *key, PyObject *item);
PyAPI_FUNC(int) PyDict_DelItem(PyObject *mp, PyObject *key); PyAPI_FUNC(int) PyDict_DelItem(PyObject *mp, PyObject *key);
PyAPI_FUNC(void) PyDict_Clear(PyObject *mp); PyAPI_FUNC(void) PyDict_Clear(PyObject *mp);
......
...@@ -27,9 +27,11 @@ PyAPI_FUNC(int) _Py_stat( ...@@ -27,9 +27,11 @@ PyAPI_FUNC(int) _Py_stat(
struct stat *statbuf); struct stat *statbuf);
#endif #endif
#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _Py_open( PyAPI_FUNC(int) _Py_open(
const char *pathname, const char *pathname,
int flags); int flags);
#endif
PyAPI_FUNC(FILE *) _Py_wfopen( PyAPI_FUNC(FILE *) _Py_wfopen(
const wchar_t *path, const wchar_t *path,
...@@ -61,12 +63,14 @@ PyAPI_FUNC(wchar_t*) _Py_wgetcwd( ...@@ -61,12 +63,14 @@ PyAPI_FUNC(wchar_t*) _Py_wgetcwd(
wchar_t *buf, wchar_t *buf,
size_t size); size_t size);
#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _Py_get_inheritable(int fd); PyAPI_FUNC(int) _Py_get_inheritable(int fd);
PyAPI_FUNC(int) _Py_set_inheritable(int fd, int inheritable, PyAPI_FUNC(int) _Py_set_inheritable(int fd, int inheritable,
int *atomic_flag_works); int *atomic_flag_works);
PyAPI_FUNC(int) _Py_dup(int fd); PyAPI_FUNC(int) _Py_dup(int fd);
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -533,8 +533,10 @@ PyAPI_FUNC(int) PyObject_Not(PyObject *); ...@@ -533,8 +533,10 @@ PyAPI_FUNC(int) PyObject_Not(PyObject *);
PyAPI_FUNC(int) PyCallable_Check(PyObject *); PyAPI_FUNC(int) PyCallable_Check(PyObject *);
PyAPI_FUNC(void) PyObject_ClearWeakRefs(PyObject *); PyAPI_FUNC(void) PyObject_ClearWeakRefs(PyObject *);
#ifndef Py_LIMITED_API
PyAPI_FUNC(void) PyObject_CallFinalizer(PyObject *); PyAPI_FUNC(void) PyObject_CallFinalizer(PyObject *);
PyAPI_FUNC(int) PyObject_CallFinalizerFromDealloc(PyObject *); PyAPI_FUNC(int) PyObject_CallFinalizerFromDealloc(PyObject *);
#endif
/* Same as PyObject_Generic{Get,Set}Attr, but passing the attributes /* Same as PyObject_Generic{Get,Set}Attr, but passing the attributes
dict as the last parameter. */ dict as the last parameter. */
......
...@@ -75,7 +75,9 @@ typedef PyOSErrorObject PyWindowsErrorObject; ...@@ -75,7 +75,9 @@ typedef PyOSErrorObject PyWindowsErrorObject;
PyAPI_FUNC(void) PyErr_SetNone(PyObject *); PyAPI_FUNC(void) PyErr_SetNone(PyObject *);
PyAPI_FUNC(void) PyErr_SetObject(PyObject *, PyObject *); PyAPI_FUNC(void) PyErr_SetObject(PyObject *, PyObject *);
#ifndef Py_LIMITED_API
PyAPI_FUNC(void) _PyErr_SetKeyError(PyObject *); PyAPI_FUNC(void) _PyErr_SetKeyError(PyObject *);
#endif
PyAPI_FUNC(void) PyErr_SetString( PyAPI_FUNC(void) PyErr_SetString(
PyObject *exception, PyObject *exception,
const char *string /* decoded from utf-8 */ const char *string /* decoded from utf-8 */
...@@ -321,16 +323,20 @@ PyAPI_FUNC(void) PyErr_SyntaxLocationEx( ...@@ -321,16 +323,20 @@ PyAPI_FUNC(void) PyErr_SyntaxLocationEx(
const char *filename, /* decoded from the filesystem encoding */ const char *filename, /* decoded from the filesystem encoding */
int lineno, int lineno,
int col_offset); int col_offset);
#ifndef Py_LIMITED_API
PyAPI_FUNC(void) PyErr_SyntaxLocationObject( PyAPI_FUNC(void) PyErr_SyntaxLocationObject(
PyObject *filename, PyObject *filename,
int lineno, int lineno,
int col_offset); int col_offset);
#endif
PyAPI_FUNC(PyObject *) PyErr_ProgramText( PyAPI_FUNC(PyObject *) PyErr_ProgramText(
const char *filename, /* decoded from the filesystem encoding */ const char *filename, /* decoded from the filesystem encoding */
int lineno); int lineno);
#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyErr_ProgramTextObject( PyAPI_FUNC(PyObject *) PyErr_ProgramTextObject(
PyObject *filename, PyObject *filename,
int lineno); int lineno);
#endif
/* The following functions are used to create and modify unicode /* The following functions are used to create and modify unicode
exceptions from C */ exceptions from C */
......
...@@ -50,6 +50,7 @@ PyAPI_FUNC(Py_hash_t) _Py_HashBytes(const void*, Py_ssize_t); ...@@ -50,6 +50,7 @@ PyAPI_FUNC(Py_hash_t) _Py_HashBytes(const void*, Py_ssize_t);
* (*) The siphash member may not be available on 32 bit platforms without * (*) The siphash member may not be available on 32 bit platforms without
* an unsigned int64 data type. * an unsigned int64 data type.
*/ */
#ifndef Py_LIMITED_API
typedef union { typedef union {
/* ensure 24 bytes */ /* ensure 24 bytes */
unsigned char uc[24]; unsigned char uc[24];
...@@ -76,6 +77,7 @@ typedef union { ...@@ -76,6 +77,7 @@ typedef union {
} expat; } expat;
} _Py_HashSecret_t; } _Py_HashSecret_t;
PyAPI_DATA(_Py_HashSecret_t) _Py_HashSecret; PyAPI_DATA(_Py_HashSecret_t) _Py_HashSecret;
#endif
#ifdef Py_DEBUG #ifdef Py_DEBUG
PyAPI_DATA(int) _Py_HashSecret_Initialized; PyAPI_DATA(int) _Py_HashSecret_Initialized;
......
...@@ -11,9 +11,11 @@ ...@@ -11,9 +11,11 @@
extern "C" { extern "C" {
#endif #endif
#ifndef Py_LIMITED_API
PyAPI_FUNC(void *) PyMem_RawMalloc(size_t size); PyAPI_FUNC(void *) PyMem_RawMalloc(size_t size);
PyAPI_FUNC(void *) PyMem_RawRealloc(void *ptr, size_t new_size); PyAPI_FUNC(void *) PyMem_RawRealloc(void *ptr, size_t new_size);
PyAPI_FUNC(void) PyMem_RawFree(void *ptr); PyAPI_FUNC(void) PyMem_RawFree(void *ptr);
#endif
/* BEWARE: /* BEWARE:
...@@ -58,8 +60,10 @@ PyAPI_FUNC(void *) PyMem_Malloc(size_t size); ...@@ -58,8 +60,10 @@ PyAPI_FUNC(void *) PyMem_Malloc(size_t size);
PyAPI_FUNC(void *) PyMem_Realloc(void *ptr, size_t new_size); PyAPI_FUNC(void *) PyMem_Realloc(void *ptr, size_t new_size);
PyAPI_FUNC(void) PyMem_Free(void *ptr); PyAPI_FUNC(void) PyMem_Free(void *ptr);
#ifndef Py_LIMITED_API
PyAPI_FUNC(char *) _PyMem_RawStrdup(const char *str); PyAPI_FUNC(char *) _PyMem_RawStrdup(const char *str);
PyAPI_FUNC(char *) _PyMem_Strdup(const char *str); PyAPI_FUNC(char *) _PyMem_Strdup(const char *str);
#endif
/* Macros. */ /* Macros. */
......
...@@ -236,7 +236,9 @@ PyAPI_FUNC(PyThreadState *) PyGILState_GetThisThreadState(void); ...@@ -236,7 +236,9 @@ PyAPI_FUNC(PyThreadState *) PyGILState_GetThisThreadState(void);
/* Helper/diagnostic function - return 1 if the current thread /* Helper/diagnostic function - return 1 if the current thread
* currently holds the GIL, 0 otherwise * currently holds the GIL, 0 otherwise
*/ */
#ifndef Py_LIMITED_API
PyAPI_FUNC(int) PyGILState_Check(void); PyAPI_FUNC(int) PyGILState_Check(void);
#endif
#endif /* #ifdef WITH_THREAD */ #endif /* #ifdef WITH_THREAD */
......
...@@ -155,10 +155,12 @@ PyAPI_FUNC(struct symtable *) Py_SymtableString( ...@@ -155,10 +155,12 @@ PyAPI_FUNC(struct symtable *) Py_SymtableString(
const char *str, const char *str,
const char *filename, /* decoded from the filesystem encoding */ const char *filename, /* decoded from the filesystem encoding */
int start); int start);
#ifndef Py_LIMITED_API
PyAPI_FUNC(struct symtable *) Py_SymtableStringObject( PyAPI_FUNC(struct symtable *) Py_SymtableStringObject(
const char *str, const char *str,
PyObject *filename, PyObject *filename,
int start); int start);
#endif
PyAPI_FUNC(void) PyErr_Print(void); PyAPI_FUNC(void) PyErr_Print(void);
PyAPI_FUNC(void) PyErr_PrintEx(int); PyAPI_FUNC(void) PyErr_PrintEx(int);
......
...@@ -8,7 +8,9 @@ extern "C" { ...@@ -8,7 +8,9 @@ extern "C" {
#endif #endif
PyAPI_FUNC(PyObject *) PySys_GetObject(const char *); PyAPI_FUNC(PyObject *) PySys_GetObject(const char *);
#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PySys_GetObjectId(_Py_Identifier *key); PyAPI_FUNC(PyObject *) _PySys_GetObjectId(_Py_Identifier *key);
#endif
PyAPI_FUNC(int) PySys_SetObject(const char *, PyObject *); PyAPI_FUNC(int) PySys_SetObject(const char *, PyObject *);
PyAPI_FUNC(int) _PySys_SetObjectId(_Py_Identifier *key, PyObject *); PyAPI_FUNC(int) _PySys_SetObjectId(_Py_Identifier *key, PyObject *);
......
...@@ -2004,10 +2004,12 @@ PyAPI_FUNC(int) PyUnicode_Compare( ...@@ -2004,10 +2004,12 @@ PyAPI_FUNC(int) PyUnicode_Compare(
PyObject *right /* Right string */ PyObject *right /* Right string */
); );
#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _PyUnicode_CompareWithId( PyAPI_FUNC(int) _PyUnicode_CompareWithId(
PyObject *left, /* Left string */ PyObject *left, /* Left string */
_Py_Identifier *right /* Right identifier */ _Py_Identifier *right /* Right identifier */
); );
#endif
PyAPI_FUNC(int) PyUnicode_CompareWithASCIIString( PyAPI_FUNC(int) PyUnicode_CompareWithASCIIString(
PyObject *left, PyObject *left,
......
...@@ -17,6 +17,7 @@ PyAPI_FUNC(int) PyErr_WarnFormat( ...@@ -17,6 +17,7 @@ PyAPI_FUNC(int) PyErr_WarnFormat(
Py_ssize_t stack_level, Py_ssize_t stack_level,
const char *format, /* ASCII-encoded string */ const char *format, /* ASCII-encoded string */
...); ...);
#ifndef Py_LIMITED_API
PyAPI_FUNC(int) PyErr_WarnExplicitObject( PyAPI_FUNC(int) PyErr_WarnExplicitObject(
PyObject *category, PyObject *category,
PyObject *message, PyObject *message,
...@@ -24,6 +25,7 @@ PyAPI_FUNC(int) PyErr_WarnExplicitObject( ...@@ -24,6 +25,7 @@ PyAPI_FUNC(int) PyErr_WarnExplicitObject(
int lineno, int lineno,
PyObject *module, PyObject *module,
PyObject *registry); PyObject *registry);
#endif
PyAPI_FUNC(int) PyErr_WarnExplicit( PyAPI_FUNC(int) PyErr_WarnExplicit(
PyObject *category, PyObject *category,
const char *message, /* UTF-8 encoded string */ const char *message, /* UTF-8 encoded string */
...@@ -32,11 +34,13 @@ PyAPI_FUNC(int) PyErr_WarnExplicit( ...@@ -32,11 +34,13 @@ PyAPI_FUNC(int) PyErr_WarnExplicit(
const char *module, /* UTF-8 encoded string */ const char *module, /* UTF-8 encoded string */
PyObject *registry); PyObject *registry);
#ifndef Py_LIMITED_API
PyAPI_FUNC(int) PyAPI_FUNC(int)
PyErr_WarnExplicitFormat(PyObject *category, PyErr_WarnExplicitFormat(PyObject *category,
const char *filename, int lineno, const char *filename, int lineno,
const char *module, PyObject *registry, const char *module, PyObject *registry,
const char *format, ...); const char *format, ...);
#endif
/* DEPRECATED: Use PyErr_WarnEx() instead. */ /* DEPRECATED: Use PyErr_WarnEx() instead. */
#ifndef Py_LIMITED_API #ifndef Py_LIMITED_API
......
...@@ -10,6 +10,9 @@ Release date: 2014-01-05 ...@@ -10,6 +10,9 @@ Release date: 2014-01-05
Core and Builtins Core and Builtins
----------------- -----------------
- Issue #19526: Exclude all new API from the stable ABI. Exceptions can be
made if a need is demonstrated.
- Issue #19969: PyBytes_FromFormatV() now raises an OverflowError if "%c" - Issue #19969: PyBytes_FromFormatV() now raises an OverflowError if "%c"
argument is not in range [0; 255]. argument is not in range [0; 255].
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment