mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 21:49:24 +08:00
This reverts commit 642f4ed606b3d66bab21d44019ae5762637eeca9. Reverted https://github.com/pytorch/pytorch/pull/100170 on behalf of https://github.com/atalman due to breaking internal builds ([comment](https://github.com/pytorch/pytorch/pull/100170#issuecomment-1540140636))
14 lines
385 B
C
14 lines
385 B
C
#pragma once
|
|
|
|
#include <c10/macros/Macros.h>
|
|
|
|
#include <Python.h>
|
|
|
|
inline PyCFunction castPyCFunctionWithKeywords(PyCFunctionWithKeywords func) {
|
|
C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wcast-function-type")
|
|
C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wcast-function-type-strict")
|
|
return reinterpret_cast<PyCFunction>(func);
|
|
C10_DIAGNOSTIC_POP()
|
|
C10_DIAGNOSTIC_POP()
|
|
}
|