Skip to content

Commit

Permalink
Fixed bug 3908 - Android, compilation of libpng and jpeg
Browse files Browse the repository at this point in the history
Sylvain

fix compilation of libpng, and warning of jpeg
  • Loading branch information
slouken committed Oct 22, 2017
1 parent 0754c78 commit d6af8ff
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
11 changes: 6 additions & 5 deletions external/jpeg-9b.patch
@@ -1,6 +1,6 @@
diff -ruN jpeg-9b.orig/Android.mk jpeg-9b/Android.mk
--- jpeg-9b.orig/Android.mk 1969-12-31 16:00:00.000000000 -0800
+++ jpeg-9b/Android.mk 2017-10-21 21:06:09.000000000 -0700
+++ jpeg-9b/Android.mk 2017-10-22 10:52:15.000000000 -0700
@@ -0,0 +1,37 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
Expand Down Expand Up @@ -41,7 +41,7 @@ diff -ruN jpeg-9b.orig/Android.mk jpeg-9b/Android.mk
+include $(BUILD_STATIC_LIBRARY)
diff -ruN jpeg-9b.orig/jconfig.h jpeg-9b/jconfig.h
--- jpeg-9b.orig/jconfig.h 1969-12-31 16:00:00.000000000 -0800
+++ jpeg-9b/jconfig.h 2017-10-21 21:06:09.000000000 -0700
+++ jpeg-9b/jconfig.h 2017-10-22 10:52:15.000000000 -0700
@@ -0,0 +1,156 @@
+/* android jconfig.h */
+/*
Expand Down Expand Up @@ -201,7 +201,7 @@ diff -ruN jpeg-9b.orig/jconfig.h jpeg-9b/jconfig.h
+#endif /* JPEG_CJPEG_DJPEG */
diff -ruN jpeg-9b.orig/jidctfst.S jpeg-9b/jidctfst.S
--- jpeg-9b.orig/jidctfst.S 1969-12-31 16:00:00.000000000 -0800
+++ jpeg-9b/jidctfst.S 2017-10-21 21:06:09.000000000 -0700
+++ jpeg-9b/jidctfst.S 2017-10-22 10:52:15.000000000 -0700
@@ -0,0 +1,476 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
Expand Down Expand Up @@ -681,8 +681,8 @@ diff -ruN jpeg-9b.orig/jidctfst.S jpeg-9b/jidctfst.S
+ .endfunc
diff -ruN jpeg-9b.orig/jmem-android.c jpeg-9b/jmem-android.c
--- jpeg-9b.orig/jmem-android.c 1969-12-31 16:00:00.000000000 -0800
+++ jpeg-9b/jmem-android.c 2017-10-21 21:06:09.000000000 -0700
@@ -0,0 +1,186 @@
+++ jpeg-9b/jmem-android.c 2017-10-22 10:52:50.000000000 -0700
@@ -0,0 +1,187 @@
+/*
+ * Copyright (C) 2007-2008 The Android Open Source Project
+ *
Expand All @@ -703,6 +703,7 @@ diff -ruN jpeg-9b.orig/jmem-android.c jpeg-9b/jmem-android.c
+#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));
Expand Down
1 change: 1 addition & 0 deletions external/jpeg-9b/jmem-android.c
Expand Up @@ -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));
Expand Down
12 changes: 9 additions & 3 deletions external/libpng-1.6.32.patch
@@ -1,6 +1,6 @@
diff -ruN libpng-1.6.32.orig/Android.mk libpng-1.6.32/Android.mk
--- libpng-1.6.32.orig/Android.mk 1969-12-31 16:00:00.000000000 -0800
+++ libpng-1.6.32/Android.mk 2017-10-21 21:07:52.000000000 -0700
+++ libpng-1.6.32/Android.mk 2017-10-22 10:52:42.000000000 -0700
@@ -0,0 +1,28 @@
+LOCAL_PATH:= $(call my-dir)
+
Expand Down Expand Up @@ -32,8 +32,8 @@ diff -ruN libpng-1.6.32.orig/Android.mk libpng-1.6.32/Android.mk
+
diff -ruN libpng-1.6.32.orig/pnglibconf.h libpng-1.6.32/pnglibconf.h
--- libpng-1.6.32.orig/pnglibconf.h 1969-12-31 16:00:00.000000000 -0800
+++ libpng-1.6.32/pnglibconf.h 2017-10-21 21:07:52.000000000 -0700
@@ -0,0 +1,211 @@
+++ libpng-1.6.32/pnglibconf.h 2017-10-22 10:52:50.000000000 -0700
@@ -0,0 +1,217 @@
+/* libpng 1.6.2 STANDARD API DEFINITION */
+
+/* pnglibconf.h - library build configuration */
Expand Down Expand Up @@ -230,12 +230,18 @@ diff -ruN libpng-1.6.32.orig/pnglibconf.h libpng-1.6.32/pnglibconf.h
+#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)
Expand Down
6 changes: 6 additions & 0 deletions external/libpng-1.6.32/pnglibconf.h
Expand Up @@ -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)
Expand Down

0 comments on commit d6af8ff

Please sign in to comment.