我的 C 函数如下所示:
void *c_shm_create(char*, int);
我的.chs
文件如下所示:
{-# LANGUAGE ForeignFunctionInterface #-}
module System.Shm.Internal.Bindings
( c_shmCreate
)
where
#include "hs_shm.h"
import C2HS
{#fun unsafe c_shm_create as c_shmCreate
{ `String'
, `Int' } -> `Ptr ()' #}
这是我得到的错误:
src\System\Shm\Internal\Bindings.chs:12: (column 18) [ERROR] >>> Missing "out" marshaller!
There is no default marshaller for this combination of Haskell and C type:
Haskell type: Ptr ()
C type : (Ptr ())
Ptr ()
我在 c2hs 文档中找不到任何关于 void 指针 ( ) 的提及。我该如何编组这个?