Closed wcout closed 5 years ago
Seems like I`ve got a better option.
Let`s just rename GIF_WHDR
to struct GIF_WHDR
, getting rid of the typedef
once and for all.
Resolved in c283802. Please confirm.
Works like a charm (and in C++ one does not even need to use struct
in the parameter declarations). Certainly the best solution.
Thank you for your work!
Great! Please don`t forget to report GIFs it decodes wrong in case you stumble upon any =) Closing as fixed.
Thanks for this awesome work!
I use GIFLIB currently for decoding, but am tempted to switch to this header only masterpiece.
There is only one minor flaw using it in class contexts:
I am including
gif_load.h
in the source file of my class. Declaring theprivate
callback methodstatic MyClass::gifLoadCallback(void *, GIF_WHDR *)
in the corresponding header is unfortunately not possible, as one cannot forward declare atypedef struct
.[Declaring the callback locally as a non member function in the source file is not an option, because called methods by
MyClass
would need to be declaredpublic
and with avoid *
argument forGIF_WHDR
- both is not very nice].As a workaround I have changed
gif_load.h
by declaring the struct without typedef as_GIF_WHDR
and follow it with atypedef struct _GIF_WHDR GIF_WHDR
and use_GIF_WHDR
for the forward declaration.Here is the diff:
Do you think this is a good solution or do you have a better idea?