Support libpng without the apng patch and fix mingw (?) compiler errors

This commit is contained in:
james 2019-02-16 14:20:55 -08:00
parent c170d01edf
commit 7e77e0c429
2 changed files with 37 additions and 2 deletions

View File

@ -25,6 +25,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "apng.h"
#define APNG_INFO_acTL 0x20000U
#define APNG_WROTE_acTL 0x10000U
struct apng_info_def
@ -59,6 +61,10 @@ size_t apng_default_tell (png_structp);
#endif/* PNG_STDIO_SUPPORTED */
void apng_write_IEND (png_structp);
void apng_write_acTL (png_structp, png_uint_32, png_uint_32);
#ifndef PNG_WRITE_APNG_SUPPORTED
void apng_set_acTL_dummy (png_structp, png_infop, apng_infop,
png_uint_32, png_uint_32);
#endif/* PNG_WRITE_APNG_SUPPORTED */
apng_infop
apng_create_info_struct (png_structp pngp)
@ -204,7 +210,7 @@ apng_set_acTL (png_structp pngp, png_infop infop, apng_infop ainfop,
ainfop->num_frames = frames;
ainfop->num_plays = plays;
ainfop->valid |= PNG_INFO_acTL;
ainfop->valid |= APNG_INFO_acTL;
return 1;
}
@ -218,7 +224,7 @@ apng_write_info_before_PLTE (png_structp pngp, png_infop infop,
png_write_info_before_PLTE(pngp, infop);
if (( ainfop->valid & PNG_INFO_acTL ) &&!( ainfop->mode & APNG_WROTE_acTL ))
if (( ainfop->valid & APNG_INFO_acTL )&&!( ainfop->mode & APNG_WROTE_acTL ))
{
ainfop->start_acTL = apng_tell(pngp, ainfop);
@ -253,6 +259,19 @@ apng_write_end (png_structp pngp, png_infop infop, apng_infop ainfop)
#endif/* PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED */
}
#ifndef PNG_WRITE_APNG_SUPPORTED
void
apng_set_acTL_dummy (png_structp pngp, png_infop infop, apng_infop ainfop,
png_uint_32 frames, png_uint_32 plays)
{
(void)pngp;
(void)infop;
(void)ainfop;
(void)frames;
(void)plays;
}
#endif/* PNG_WRITE_APNG_SUPPORTED */
/* Dynamic runtime linking capable! (Hopefully.) */
void
apng_set_set_acTL_fn (png_structp pngp, apng_infop ainfop,

View File

@ -23,6 +23,22 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef APNG_H
#define APNG_H
#ifndef _MSC_VER
#ifndef _WII
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#endif
#endif
#endif
#ifndef _LFS64_LARGEFILE
#define _LFS64_LARGEFILE
#endif
#ifndef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 0
#endif
#include <png.h>
typedef struct apng_info_def apng_info;