SDL kütüphanesinin D ilintilerini kullanmaya çalışırken bir hata aldım.
Hata mesajı şu şekildeydi.
Alıntı:
>SDL_thread.d(37): C-style function pointer and pointer to array syntax is deprecated. Use 'function' to declare function pointers
Biraz araştırdıktan sonra bu şekilde değiştirdim.
void function (void *userdata, Uint8 *stream, int len) callback;
C versiyonu:
//void (*callback)(void *userdata, Uint8 *stream, int len);
Gene genelde diğerleri de bu yapıdaydı
typedef int function (SDL_RWops *context, int offset, int whence) _seek_func_t;
C versiyonu:
//typedef int (*_seek_func_t)(SDL_RWops *context, int offset, int whence);
Sadece iki tane kaldı. Ama bunları çeviremedim. Bir tanesi bir yapının içinde olduğu için yapıyı da yazdım.
struct SDL_AudioCVT {
int needed; /* Set to 1 if conversion possible */
Uint16 src_format; /* Source audio format */
Uint16 dst_format; /* Target audio format */
double rate_incr; /* Rate conversion increment */
Uint8 *buf; /* Buffer to hold entire audio data */
int len; /* Length of original audio buffer */
int len_cvt; /* Length of converted audio buffer */
int len_mult; /* buffer must be len*len_mult big */
double len_ratio; /* Given len, final size is len*len_ratio */
void (*filters[10])(SDL_AudioCVT *cvt, Uint16 format); // <-- bunu çeviremedim
int filter_index; /* Current audio conversion function */
}
Yani çeviremediklerim bu ikisi.Açık olsun diye üsttekini de ayrıca yazayım.
SDL_Thread * SDL_CreateThread(int (*fn)(void *), void *data);
void (*filters[10])(SDL_AudioCVT *cvt, Uint16 format); // <-- bunu çeviremedim
Bunları nasıl D'ye çevirebiliriz acaba. Umarım bu kadar uğraştıktan sonra çalışır :)
--
[ Bu gönderi, http://ddili.org/forum'dan dönüştürülmüştür. ]