Skip to content

Commit 286d38e

Browse files
committed
Export functions
1 parent 54607ee commit 286d38e

13 files changed

Lines changed: 32 additions & 32 deletions

Include/internal/pycore_abstract.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ _PyIndex_Check(PyObject *obj)
1616
return (tp_as_number != NULL && tp_as_number->nb_index != NULL);
1717
}
1818

19-
PyObject *_PyNumber_PowerNoMod(PyObject *lhs, PyObject *rhs);
20-
PyObject *_PyNumber_InPlacePowerNoMod(PyObject *lhs, PyObject *rhs);
19+
PyAPI_FUNC(PyObject *) _PyNumber_PowerNoMod(PyObject *lhs, PyObject *rhs);
20+
PyAPI_FUNC(PyObject *) _PyNumber_InPlacePowerNoMod(PyObject *lhs, PyObject *rhs);
2121

22-
extern int _PyObject_HasLen(PyObject *o);
22+
PyAPI_FUNC(int) _PyObject_HasLen(PyObject *o);
2323

2424
/* === Sequence protocol ================================================ */
2525

Include/internal/pycore_call.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ _PyStack_UnpackDict(PyThreadState *tstate,
166166
PyObject *const *args, Py_ssize_t nargs,
167167
PyObject *kwargs, PyObject **p_kwnames);
168168

169-
extern void _PyStack_UnpackDict_Free(
169+
PyAPI_FUNC(void) _PyStack_UnpackDict_Free(
170170
PyObject *const *stack,
171171
Py_ssize_t nargs,
172172
PyObject *kwnames);

Include/internal/pycore_dict.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ PyAPI_FUNC(int) _PyDict_SetItem_KnownHash(PyObject *mp, PyObject *key,
3131
PyAPI_FUNC(int) _PyDict_DelItem_KnownHash(PyObject *mp, PyObject *key,
3232
Py_hash_t hash);
3333

34-
extern int _PyDict_DelItem_KnownHash_LockHeld(PyObject *mp, PyObject *key,
34+
PyAPI_FUNC(int) _PyDict_DelItem_KnownHash_LockHeld(PyObject *mp, PyObject *key,
3535
Py_hash_t hash);
3636

3737
extern int _PyDict_Contains_KnownHash(PyObject *, PyObject *, Py_hash_t);
@@ -89,7 +89,7 @@ extern PyObject *_PyDict_FromKeys(PyObject *, PyObject *, PyObject *);
8989

9090
/* Gets a version number unique to the current state of the keys of dict, if possible.
9191
* Returns the version number, or zero if it was not possible to get a version number. */
92-
extern uint32_t _PyDictKeys_GetVersionForCurrentState(
92+
PyAPI_FUNC(uint32_t) _PyDictKeys_GetVersionForCurrentState(
9393
PyInterpreterState *interp, PyDictKeysObject *dictkeys);
9494

9595
/* Gets a version number unique to the current state of the keys of dict, if possible.
@@ -100,7 +100,7 @@ extern uint32_t _PyDictKeys_GetVersionForCurrentState(
100100
* The caller must hold the per-object lock on dict.
101101
*
102102
* Returns the version number, or zero if it was not possible to get a version number. */
103-
extern uint32_t _PyDict_GetKeysVersionForCurrentState(
103+
PyAPI_FUNC(uint32_t) _PyDict_GetKeysVersionForCurrentState(
104104
PyInterpreterState *interp, PyDictObject *dict);
105105

106106
extern size_t _PyDict_KeysSize(PyDictKeysObject *keys);
@@ -110,15 +110,15 @@ extern void _PyDictKeys_DecRef(PyDictKeysObject *keys);
110110
/* _Py_dict_lookup() returns index of entry which can be used like DK_ENTRIES(dk)[index].
111111
* -1 when no entry found, -3 when compare raises error.
112112
*/
113-
extern Py_ssize_t _Py_dict_lookup(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject **value_addr);
113+
PyAPI_FUNC(Py_ssize_t) _Py_dict_lookup(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject **value_addr);
114114
extern Py_ssize_t _Py_dict_lookup_threadsafe(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject **value_addr);
115115
extern Py_ssize_t _Py_dict_lookup_threadsafe_stackref(PyDictObject *mp, PyObject *key, Py_hash_t hash, _PyStackRef *value_addr);
116116

117117
extern int _PyDict_GetMethodStackRef(PyDictObject *dict, PyObject *name, _PyStackRef *method);
118118

119-
extern Py_ssize_t _PyDict_LookupIndexAndValue(PyDictObject *, PyObject *, PyObject **);
120-
extern Py_ssize_t _PyDict_LookupIndex(PyDictObject *, PyObject *);
121-
extern Py_ssize_t _PyDictKeys_StringLookup(PyDictKeysObject* dictkeys, PyObject *key);
119+
PyAPI_FUNC(Py_ssize_t) _PyDict_LookupIndexAndValue(PyDictObject *, PyObject *, PyObject **);
120+
PyAPI_FUNC(Py_ssize_t) _PyDict_LookupIndex(PyDictObject *, PyObject *);
121+
PyAPI_FUNC(Py_ssize_t) _PyDictKeys_StringLookup(PyDictKeysObject* dictkeys, PyObject *key);
122122

123123
/* Look up a string key in an all unicode dict keys, assign the keys object a version, and
124124
* store it in version.
@@ -128,8 +128,8 @@ extern Py_ssize_t _PyDictKeys_StringLookup(PyDictKeysObject* dictkeys, PyObject
128128
*
129129
* Returns DKIX_EMPTY if the key is not present.
130130
*/
131-
extern Py_ssize_t _PyDictKeys_StringLookupAndVersion(PyDictKeysObject* dictkeys, PyObject *key, uint32_t *version);
132-
extern Py_ssize_t _PyDictKeys_StringLookupSplit(PyDictKeysObject* dictkeys, PyObject *key);
131+
PyAPI_FUNC(Py_ssize_t) _PyDictKeys_StringLookupAndVersion(PyDictKeysObject* dictkeys, PyObject *key, uint32_t *version);
132+
PyAPI_FUNC(Py_ssize_t) _PyDictKeys_StringLookupSplit(PyDictKeysObject* dictkeys, PyObject *key);
133133
PyAPI_FUNC(PyObject *)_PyDict_LoadGlobal(PyDictObject *, PyDictObject *, PyObject *);
134134
PyAPI_FUNC(void) _PyDict_LoadGlobalStackRef(PyDictObject *, PyDictObject *, PyObject *, _PyStackRef *);
135135

@@ -139,7 +139,7 @@ extern PyObject *_PyDict_LoadBuiltinsFromGlobals(PyObject *globals);
139139
/* Consumes references to key and value */
140140
PyAPI_FUNC(int) _PyDict_SetItem_Take2(PyDictObject *op, PyObject *key, PyObject *value);
141141
PyAPI_FUNC(int) _PyDict_SetItem_Take2_KnownHash(PyDictObject *op, PyObject *key, PyObject *value, Py_hash_t hash);
142-
extern int _PyDict_SetItem_LockHeld(PyDictObject *dict, PyObject *name, PyObject *value);
142+
PyAPI_FUNC(int) _PyDict_SetItem_LockHeld(PyDictObject *dict, PyObject *name, PyObject *value);
143143
// Export for '_asyncio' shared extension
144144
PyAPI_FUNC(int) _PyDict_SetItem_KnownHash_LockHeld(PyDictObject *mp, PyObject *key,
145145
PyObject *value, Py_hash_t hash);

Include/internal/pycore_frame.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct _frame {
3838
PyObject *_f_frame_data[1];
3939
};
4040

41-
extern PyFrameObject* _PyFrame_New_NoTrack(PyCodeObject *code);
41+
PyAPI_FUNC(PyFrameObject *) _PyFrame_New_NoTrack(PyCodeObject *code);
4242

4343

4444
/* other API */

Include/internal/pycore_function.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ _PyFunction_IsVersionValid(uint32_t version)
2727
return version >= FUNC_VERSION_FIRST_VALID;
2828
}
2929

30-
extern uint32_t _PyFunction_GetVersionForCurrentState(PyFunctionObject *func);
30+
PyAPI_FUNC(uint32_t) _PyFunction_GetVersionForCurrentState(PyFunctionObject *func);
3131
PyAPI_FUNC(void) _PyFunction_SetVersion(PyFunctionObject *func, uint32_t version);
3232
void _PyFunction_ClearCodeByVersion(uint32_t version);
3333

Include/internal/pycore_gc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ extern Py_ssize_t _PyGC_Collect(PyThreadState *tstate, int generation, _PyGC_Rea
348348
extern void _PyGC_CollectNoFail(PyThreadState *tstate);
349349

350350
/* Freeze objects tracked by the GC and ignore them in future collections. */
351-
extern void _PyGC_Freeze(PyInterpreterState *interp);
351+
PyAPI_FUNC(void) _PyGC_Freeze(PyInterpreterState *interp);
352352
/* Unfreezes objects placing them in the oldest generation */
353353
extern void _PyGC_Unfreeze(PyInterpreterState *interp);
354354
/* Number of frozen objects */

Include/internal/pycore_interpframe.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ _PyFrame_GetFrameObject(_PyInterpreterFrame *frame)
302302
return _PyFrame_MakeAndSetFrameObject(frame);
303303
}
304304

305-
void
305+
PyAPI_FUNC(void)
306306
_PyFrame_ClearLocals(_PyInterpreterFrame *frame);
307307

308308
/* Clears all references in the frame.
@@ -314,7 +314,7 @@ _PyFrame_ClearLocals(_PyInterpreterFrame *frame);
314314
* take should be set to 1 for heap allocated
315315
* frames like the ones in generators and coroutines.
316316
*/
317-
void
317+
PyAPI_FUNC(void)
318318
_PyFrame_ClearExceptCode(_PyInterpreterFrame * frame);
319319

320320
int
@@ -338,7 +338,7 @@ _PyThreadState_HasStackSpace(PyThreadState *tstate, int size)
338338
size < tstate->datastack_limit - tstate->datastack_top;
339339
}
340340

341-
extern _PyInterpreterFrame *
341+
PyAPI_FUNC(_PyInterpreterFrame *)
342342
_PyThreadState_PushFrame(PyThreadState *tstate, size_t size);
343343

344344
PyAPI_FUNC(void) _PyThreadState_PopFrame(PyThreadState *tstate, _PyInterpreterFrame *frame);

Include/internal/pycore_object.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ Py_ssize_t _Py_ExplicitMergeRefcount(PyObject *op, Py_ssize_t extra);
283283

284284

285285
extern int _PyType_CheckConsistency(PyTypeObject *type);
286-
extern int _PyDict_CheckConsistency(PyObject *mp, int check_content);
286+
PyAPI_FUNC(int) _PyDict_CheckConsistency(PyObject *mp, int check_content);
287287

288288
// Fast inlined version of PyType_HasFeature()
289289
static inline int
@@ -879,14 +879,14 @@ PyAPI_FUNC(PyObject *) _PyType_NewManagedObject(PyTypeObject *type);
879879
extern PyTypeObject* _PyType_CalculateMetaclass(PyTypeObject *, PyObject *);
880880
extern PyObject* _PyType_GetDocFromInternalDoc(const char *, const char *);
881881
extern PyObject* _PyType_GetTextSignatureFromInternalDoc(const char *, const char *, int);
882-
extern int _PyObject_SetAttributeErrorContext(PyObject *v, PyObject* name);
882+
PyAPI_FUNC(int) _PyObject_SetAttributeErrorContext(PyObject *v, PyObject* name);
883883

884884
void _PyObject_InitInlineValues(PyObject *obj, PyTypeObject *tp);
885885
extern int _PyObject_StoreInstanceAttribute(PyObject *obj,
886886
PyObject *name, PyObject *value);
887887
extern bool _PyObject_TryGetInstanceAttribute(PyObject *obj, PyObject *name,
888888
PyObject **attr);
889-
extern PyObject *_PyType_LookupRefAndVersion(PyTypeObject *, PyObject *,
889+
PyAPI_FUNC(PyObject *) _PyType_LookupRefAndVersion(PyTypeObject *, PyObject *,
890890
unsigned int *);
891891

892892
// Internal API to look for a name through the MRO.
@@ -910,7 +910,7 @@ PyAPI_FUNC(_PyStackRef) _PyObject_GetAttrStackRef(PyObject *obj, PyObject *name)
910910
// deferred reference counting.
911911
//
912912
// Returns 1 if the value was cached or 0 otherwise.
913-
extern int _PyType_CacheInitForSpecialization(PyHeapTypeObject *type,
913+
PyAPI_FUNC(int) _PyType_CacheInitForSpecialization(PyHeapTypeObject *type,
914914
PyObject *init,
915915
unsigned int tp_version);
916916

Include/internal/pycore_obmalloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ struct _obmalloc_state {
702702
* Large-page and huge-page backends may round the mapped size up
703703
* internally, so pass the original requested size back to
704704
* _PyObject_VirtualFree(). */
705-
void *_PyObject_VirtualAlloc(size_t size);
705+
PyAPI_FUNC(void *) _PyObject_VirtualAlloc(size_t size);
706706
void _PyObject_VirtualFree(void *, size_t size);
707707

708708

Include/internal/pycore_pyerrors.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ extern PyObject* _PyErr_FormatFromCauseTstate(
170170
const char *format,
171171
...);
172172

173-
extern PyObject* _PyExc_CreateExceptionGroup(
173+
PyAPI_FUNC(PyObject *) _PyExc_CreateExceptionGroup(
174174
const char *msg,
175175
PyObject *excs);
176176

@@ -181,7 +181,7 @@ extern PyObject* _PyExc_PrepReraiseStar(
181181
extern int _PyErr_CheckSignalsTstate(PyThreadState *tstate);
182182

183183
extern void _Py_DumpExtensionModules(int fd, PyInterpreterState *interp);
184-
extern PyObject* _Py_CalculateSuggestions(PyObject *dir, PyObject *name);
184+
PyAPI_FUNC(PyObject *) _Py_CalculateSuggestions(PyObject *dir, PyObject *name);
185185
extern PyObject* _Py_Offer_Suggestions(PyObject* exception);
186186

187187
// Export for '_testinternalcapi' shared extension

0 commit comments

Comments
 (0)