Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C 过滤器类型未声明?_C_Macos_Kernel Module_Mach_Kernel Extension - Fatal编程技术网

C 过滤器类型未声明?

C 过滤器类型未声明?,c,macos,kernel-module,mach,kernel-extension,C,Macos,Kernel Module,Mach,Kernel Extension,我应该使用中断过滤器传递给函数,但问题是,我的Xcode总是告诉我过滤器类型未声明 以下是我的部分代码: interruptSrc = IOFilterInterruptEventSource::filterInterruptEventSource((OSObject*)this, (IOInterruptEventAction)&VoodooSDHC::interruptHandler,

我应该使用
中断过滤器
传递给函数,但问题是,我的Xcode总是告诉我
过滤器
类型未声明

以下是我的部分代码:

interruptSrc = IOFilterInterruptEventSource::filterInterruptEventSource((OSObject*)this,
                                   (IOInterruptEventAction)&VoodooSDHC::interruptHandler,
                                   (Filter)&VoodooSDHC::interruptFilter,
                                   (IOService*)provider);
我不熟悉
Mac
Xcode
,所以我真的不知道在这种情况下该怎么办


当函数实际获取该类型的参数时,它如何抱怨它没有定义?

您获取某个对象的地址,并将其强制转换为看起来不像指针的对象。要么是指针typedef(恶魔之子),要么不是一个好的施法

你确定不应该是:

(Filter *)&VoodooSDHC::interruptFilter,

这是唯一的编译错误吗?并且声明
Filter
的标题是否包含在当前翻译单元中,在此行之前?哦,你可以转寄申报。顺便说一句,您正在传递一个指针,
Filter
是指针类型吗?在所有警告都打开的情况下编译,并发布您得到的所有编译器输出。