liballeg / allegro5

The official Allegro 5 git repository. Pull requests welcome!
https://liballeg.org
Other
1.9k stars 285 forks source link

allegro in the current version, with visual studio 2019, with the FreeImage add-on does not compile if it does not cast to each of the fio.***proc #1591

Closed carlweiss32 closed 2 days ago

carlweiss32 commented 1 week ago

Building allegro in the current version, with visual studio 2019, with the FreeImage add-on in allegro_image project, does not compile if it does not cast to each of the fio.*_proc of funtions _al_load_fi_bitmap_f and _al_identify_fi, File freeimage.c

funtion in line 120 ALLEGRO_BITMAP _al_load_fi_bitmap_f(ALLEGRO_FILE f, int flags) { .... fio.read_proc = (FI_ReadProc)_fiio_al_read; fio.write_proc =(FI_WriteProc)_fiio_al_write; fio.seek_proc = (FI_SeekProc)_fiio_al_fseek; fio.tell_proc = (FI_TellProc)_fiio_al_ftell; }

function in line 160 bool _al_identify_fi(ALLEGRO_FILE *f) { ... fio.read_proc = (FI_ReadProc) _fiio_al_read; fio.write_proc =(FI_WriteProc) _fiio_al_write; fio.seek_proc = (FI_SeekProc) _fiio_al_fseek; fio.tell_proc = (FI_TellProc) _fiio_al_ftell; }

SiegeLord commented 2 days ago

Thanks. A cast isn't quite correct, the functions need to have a correct calling convention.