We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3908

Summary: Android, compilation of libpng and jpeg
Product: SDL_image Reporter: Sylvain <sylvain.becker>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: unspecified   
Hardware: x86_64   
OS: Linux   

Description Sylvain 2017-10-22 13:25:00 UTC
fix compilation of libpng, and warning of jpeg

diff -r 4491ac456363 external/jpeg-9b/jmem-android.c
--- a/external/jpeg-9b/jmem-android.c	Sun Oct 22 02:05:28 2017 -0700
+++ b/external/jpeg-9b/jmem-android.c	Sun Oct 22 15:24:03 2017 +0200
@@ -18,6 +18,7 @@
 #include "jinclude.h"
 #include "jpeglib.h"
 #include "jmemsys.h"		/* import the system-dependent declarations */
+#include <unistd.h>         /* For unlink() and getpid() */
 
 #ifndef HAVE_STDLIB_H		/* <stdlib.h> should declare malloc(),free() */
 extern void * malloc JPP((size_t size));
diff -r 4491ac456363 external/libpng-1.6.32/pnglibconf.h
--- a/external/libpng-1.6.32/pnglibconf.h	Sun Oct 22 02:05:28 2017 -0700
+++ b/external/libpng-1.6.32/pnglibconf.h	Sun Oct 22 15:24:03 2017 +0200
@@ -194,12 +194,18 @@
 #define PNG_GAMMA_THRESHOLD_FIXED 5000
 #define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE
 #define PNG_INFLATE_BUF_SIZE 1024
+#define PNG_LINKAGE_API extern
+#define PNG_LINKAGE_CALLBACK extern
+#define PNG_LINKAGE_DATA extern
+#define PNG_LINKAGE_FUNCTION extern
 #define PNG_MAX_GAMMA_8 11
 #define PNG_QUANTIZE_BLUE_BITS 5
 #define PNG_QUANTIZE_GREEN_BITS 5
 #define PNG_QUANTIZE_RED_BITS 5
 #define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1)
 #define PNG_TEXT_Z_DEFAULT_STRATEGY 0
+#define PNG_USER_HEIGHT_MAX 1000000
+#define PNG_USER_WIDTH_MAX 1000000
 #define PNG_WEIGHT_SHIFT 8
 #define PNG_ZBUF_SIZE 8192
 #define PNG_Z_DEFAULT_COMPRESSION (-1)
Comment 1 Sam Lantinga 2017-10-22 17:54:45 UTC
Added, thanks!
https://hg.libsdl.org/SDL_image/rev/0f004b24510a