com php-src: Move png and jpeg version functions to gd.c so the external library build doesn't include anything from libgd/.: ext/gd/config.m4
ext/gd/gd.c ext/gd/libgd/gd_compat.c ext/gd/libgd/gd_co mpat.h
| From: | Remi Collet | Date: | Sat, 04 May 2013 14:50:13 +0000 |
| Subject: | com php-src: Move png and jpeg version functions to gd.c so the external library build doesn't include anything from libgd/.: ext/gd/config.m4 ext/gd/gd.c ext/gd/libgd/gd_compat.c ext/gd/libgd/gd_co mpat.h |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-72117@lists.php.net to get a copy of this message | ||
Commit: 2a2ac5f2bef6a779477c76d34c346ac9044185af
Author: Ondřej Surý <ondrej@sury.org> Fri, 3 May 2013 15:37:39 +0200
Committer: Remi Collet <remi@php.net> Sat, 4 May 2013 16:50:13 +0200
Parents: e6704501f8ab56d661f37c4e70b0b9e442ca5ed2
Branches: PHP-5.5
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2a2ac5f2bef6a779477c76d34c346ac9044185af
Log:
Move png and jpeg version functions to gd.c so the external library build doesn't include
anything from libgd/.
Changed paths:
M ext/gd/config.m4
M ext/gd/gd.c
D ext/gd/libgd/gd_compat.c
D ext/gd/libgd/gd_compat.h
Diff:
diff --git a/ext/gd/config.m4 b/ext/gd/config.m4
index 4a29ab9..5d02bed 100644
--- a/ext/gd/config.m4
+++ b/ext/gd/config.m4
@@ -337,7 +337,6 @@ else
if test "$PHP_GD" != "no"; then
GD_MODULE_TYPE=external
- extra_sources="libgd/gd_compat.c"
dnl Various checks for GD features
PHP_GD_ZLIB
diff --git a/ext/gd/gd.c b/ext/gd/gd..c
index eefa5df..f412b2f 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -29,6 +29,14 @@
#include "config.h"
#endif
+#ifdef HAVE_GD_PNG
+#include <png.h>
+#endif
+
+#ifdef HAVE_GD_JPG
+# include <jpeglib.h>
+#endif
+
#include "php.h"
#include "php_ini.h"
#include "ext/standard/head.h"
@@ -53,6 +61,42 @@
# include <Wingdi.h>
#endif
+#ifndef HAVE_GD_BUNDLED
+#ifdef HAVE_GD_PNG
+const char * gdPngGetVersionString()
+{
+ return PNG_LIBPNG_VER_STRING;
+}
+#endif /* HAVE_GD_PNG */
+
+#ifdef HAVE_GD_JPG
+int gdJpegGetVersionInt()
+{
+ return JPEG_LIB_VERSION;
+}
+
+const char * gdJpegGetVersionString()
+{
+ switch(JPEG_LIB_VERSION) {
+ case 62:
+ return "6b";
+ break;
+
+ case 70:
+ return "7";
+ break;
+
+ case 80:
+ return "8";
+ break;
+
+ default:
+ return "unknown";
+ }
+}
+#endif /* HAVE_GD_JPG */
+#endif /* HAVE_GD_BUNDLED */
+
static int le_gd, le_gd_font;
#if HAVE_LIBT1
#include <t1lib..h>
@@ -1310,6 +1354,7 @@ PHP_MINFO_FUNCTION(gd)
php_info_print_table_row(2, "libJPEG Version", gdJpegGetVersionString());
}
#endif
+
#ifdef HAVE_GD_PNG
php_info_print_table_row(2, "PNG Support", "enabled");
php_info_print_table_row(2, "libPNG Version", gdPngGetVersionString());
diff --git a/ext/gd/libgd/gd_compat.c b/ext/gd/libgd/gd_compat.c
deleted file mode 100644
index 875fbd6..0000000
--- a/ext/gd/libgd/gd_compat.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "php_config.h"
-#ifdef HAVE_GD_PNG
-/* needs to be first */
-# include <png.h>
-#endif
-
-#ifdef HAVE_GD_JPG
-# include <jpeglib.h>
-#endif
-
-#ifdef HAVE_GD_JPG
-int gdJpegGetVersionInt()
-{
- return JPEG_LIB_VERSION;
-}
-
-const char * gdJpegGetVersionString()
-{
- switch(JPEG_LIB_VERSION) {
- case 62:
- return "6b";
- break;
- default:
- return "unknown";
- }
-}
-#endif
-
-#ifdef HAVE_GD_PNG
-const char * gdPngGetVersionString()
-{
- return PNG_LIBPNG_VER_STRING;
-}
-#endif
diff --git a/ext/gd/libgd/gd_compat.h b/ext/gd/libgd/gd_compat.h
deleted file mode 100644
index 13fff2b..0000000
--- a/ext/gd/libgd/gd_compat.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef GD_COMPAT_H
-#define GD_COMPAT_H 1
-
-#if HAVE_GD_BUNDLED
-# include "gd.h"
-#else
-# include <gd.h>
-#endif
-
-const char * gdPngGetVersionString();
-const char * gdJpegGetVersionString();
-int gdJpegGetVersionInt();
-
-#endif /* GD_COMPAT_H */