cvs: php4 /ext/gd config.m4 /ext/gd/libgd gd.c
| From: | Marcus B�rger | Date: | Mon, 12 Aug 2002 13:59:01 +0000 |
| Subject: | cvs: php4 /ext/gd config.m4 /ext/gd/libgd gd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-13277@lists.php.net to get a copy of this message | ||
helly Mon Aug 12 09:59:01 2002 EDT
Modified files:
/php4/ext/gd config.m4
/php4/ext/gd/libgd gd.c
Log:
check for fabsf and floorf in config.m4
msvc.6 needs a define, msvc.net needs special treatment
Index: php4/ext/gd/config.m4
diff -u php4/ext/gd/config.m4:1.105 php4/ext/gd/config.m4:1.106
--- php4/ext/gd/config.m4:1.105 Mon Jul 22 21:11:16 2002
+++ php4/ext/gd/config.m4 Mon Aug 12 09:59:01 2002
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.105 2002/07/23 01:11:16 sniper Exp $
+dnl $Id: config.m4,v 1.106 2002/08/12 13:59:01 helly Exp $
dnl
dnl
@@ -239,6 +239,9 @@
PHP_NEW_EXTENSION(gd, gd.c gdttf.c $sources, $ext_shared,, \\$(GDLIB_CFLAGS))
PHP_ADD_BUILD_DIR($ext_builddir/libgd)
+
+dnl check for fabsf and floorf which are available since C99
+ AC_CHECK_FUNCS(fabsf floorf)
dnl PNG is required by GD library
test "$PHP_PNG_DIR" = "no" && PHP_PNG_DIR=yes
Index: php4/ext/gd/libgd/gd.c
diff -u php4/ext/gd/libgd/gd.c:1.10 php4/ext/gd/libgd/gd.c:1.11
--- php4/ext/gd/libgd/gd.c:1.10 Mon Aug 12 05:58:51 2002
+++ php4/ext/gd/libgd/gd.c Mon Aug 12 09:59:01 2002
@@ -2,25 +2,42 @@
#include <math.h>
#include <string.h>
#include <stdlib.h>
-#include <zlib.h>
#include "gd.h"
#include "gdhelpers.h"
-#ifdef _OSD_POSIX /* BS2000 uses the EBCDIC char set instead of ASCII */
-#define CHARSET_EBCDIC
-#define __attribute__(any) /*nothing */
-#endif
-/*_OSD_POSIX*/
+#include "php_config.h"
#ifdef _MSC_VER
-#if _MSC_VER < 1300
-/* following functions are available since MSVC.NET, emulate for earlier versions */
+# if _MSC_VER >= 1300
+/* in MSVC.NET the these are available but only for __cplusplus and not _MSC_EXTENSIONS */
+# ifdef _MSC_EXTENSIONS
+# define HAVE_FABSF 1
+extern float fabsf(float x);
+# define HAVE_FLOORF 1
+extern float floorf(float x);
+# endif /*MSVC.NET */
+# endif /* MSC */
+#endif
+#ifndef HAVE_FABSF
+# define HAVE_FABSF 0
+#endif
+#ifndef HAVE_FLOORF
+# define HAVE_FLOORF 0
+#endif
+#if HAVE_FABSF == 0
/* float fabsf(float x); */
-#define fabsf(x) ((float)(abs(x)))
+# define fabsf(x) ((float)(abs(x)))
+#endif
+#if HAVE_FLOORF == 0
/* float floorf(float x);*/
#define floorf(x) ((float)(floor(x)))
#endif
+
+#ifdef _OSD_POSIX /* BS2000 uses the EBCDIC char set instead of ASCII */
+#define CHARSET_EBCDIC
+#define __attribute__(any) /*nothing */
#endif
+/*_OSD_POSIX*/
#ifndef CHARSET_EBCDIC
#define ASC(ch) ch