mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Use cpython declaration of _PyWeakref_ClearRef (#136300)
To avoid the DLL inconsistency warning by MSVC: ``` torch/csrc/utils/python_compat.h(38): warning C4273: '_PyWeakref_ClearRef': inconsistent dll linkage ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/136300 Approved by: https://github.com/Skylion007
This commit is contained in:
parent
7f9c06462f
commit
d2455b99fb
|
|
@ -35,7 +35,11 @@ PyCode_GetNFreevars(PyCodeObject* code) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Provided by CPython but getting the header for them is very hard
|
// Provided by CPython but getting the header for them is very hard
|
||||||
|
#if IS_PYTHON_3_11_PLUS
|
||||||
|
PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference* self);
|
||||||
|
#else
|
||||||
extern void _PyWeakref_ClearRef(PyWeakReference* self);
|
extern void _PyWeakref_ClearRef(PyWeakReference* self);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user