# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/graph/_host_callback.pyx

from __future__ import annotations

import sys

_CUHOSTFN_HINT = 'ctypes.CFUNCTYPE(None, ctypes.c_void_p)' if sys.platform != 'win32' else 'ctypes.CFUNCTYPE(None, ctypes.c_void_p) or ctypes.WINFUNCTYPE(None, ctypes.c_void_p)'

def _cuhostfn_type_error(detail):
    """Build the rejection message for a non-conforming ctypes callback."""

def _validate_ctypes_host_callback(fn):
    """Reject ctypes callbacks whose declared prototype is not CUhostFn.

    ``restype`` and ``argtypes`` are the prototype the caller declared, and are
    what CUDA calls through. A function pointer taken from a shared library
    keeps ctypes' defaults -- a ``c_int`` result and unspecified arguments --
    until the caller declares otherwise, so it must be declared to be accepted.
    """