我知道已经发布了一个类似的问题,但它的解决方案不适合我。在我的规范文件中,我有代码:
type Colour_Component is mod 256;
type Colour is
record
A, R, G, B : Colour_Component;
end record;
type Raw_Image_Data is array (Interfaces.C.int range <>) of Colour;
type Raw_Image is access all Raw_Image_Data;
pragma Convention (C, Raw_Image);
然后我尝试与C函数接口:
function C_SDL_CreateRGBSurfaceFrom (
Pixels : Raw_Image;
Width : int;
Height : int;
Depth : int;
Pitch : int;
Rmask : Unsigned_32;
Gmask : Unsigned_32;
Bmask : Unsigned_32;
Amask : Unsigned_32)
return System.Address;
pragma Import (C, C_SDL_CreateRGBSurfaceFrom, "SDL_CreateRGBSurfaceFrom");
但当我试图编译它时,我得到了一个警告:
warning: type of "C_SDL_CreateRGBSurfaceFrom.Pixels" does not correspond to C pointer
warning: this access type does not correspond to C pointer
由于我将编译器标志设置为将警告视为错误,因此无法编译。关于如何解决这个问题,有什么建议吗?