am 791d8f2e: Upgrading libpng to 1.2.46 to fix a few vulnerabilities. DO NOT MERGE
* commit '791d8f2ed98581c67bf9c1ad56d3140719c1882a':
Upgrading libpng to 1.2.46 to fix a few vulnerabilities. DO NOT MERGE
diff --git a/Android.mk b/Android.mk
index 2a6eb43..4e92908 100644
--- a/Android.mk
+++ b/Android.mk
@@ -22,9 +22,18 @@
pngwtran.c \
pngwutil.c
-common_CFLAGS := ## -fomit-frame-pointer
+common_CFLAGS := -fvisibility=hidden ## -fomit-frame-pointer
-common_C_INCLUDES += \
+ifeq ($(HOST_OS),windows)
+ ifeq ($(USE_MINGW),)
+ # Case where we're building windows but not under linux (so it must be cygwin)
+ # In this case, gcc cygwin doesn't recognize -fvisibility=hidden
+ $(info libpng: Ignoring gcc flag $(common_CFLAGS) on Cygwin)
+ common_CFLAGS :=
+ endif
+endif
+
+common_C_INCLUDES +=
common_COPY_HEADERS_TO := libpng
common_COPY_HEADERS := png.h pngconf.h pngusr.h
diff --git a/pngconf.h b/pngconf.h
index 82c6008..219b42e 100644
--- a/pngconf.h
+++ b/pngconf.h
@@ -1509,7 +1509,11 @@
# define PNGAPI
#endif
#ifndef PNG_IMPEXP
-# define PNG_IMPEXP
+# if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33)
+# define PNG_IMPEXP __attribute__((visibility ("default")))
+# else
+# define PNG_IMPEXP
+# endif
#endif
#ifdef PNG_BUILDSYMS