Files
pytorch/torch/csrc/utils/pycfunction_helpers.h
PyTorch MergeBot 01476465dd Revert "add a cast function that suppresses -Wcast-function-type-strict (#100170)"
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))
2023-05-09 13:56:48 +00:00

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()
}