dnl If we are using gcc and the user has not specified CFLAGS, add -O2.
test -n "$auto_cflags" && test -n "$GCC" && CFLAGS="$CFLAGS -O2"
-
-
-
CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
+
export CPPFLAGS
if test "$PHP_THREAD_SAFETY" = "yes" || test "$PHP_EXPERIMENTAL_ZTS" = "yes"; then
/* Note that there is no code from the gd package in this file */
+#ifdef PIC
+# define COMPILE_DL 1
+#endif
+
#include "php.h"
#include "ext/standard/head.h"
#include <math.h>
};
#if COMPILE_DL
-# if PHP_31
-# include "../phpdl.h"
-# else
-# include "dl/phpdl.h"
-# endif
+# include "dl/phpdl.h"
DLEXPORT php3_module_entry *get_module(void) { return &gd_module_entry; }
#endif
#include <freetype.h>
#endif
+#ifndef HAVE_GDIMAGECOLORRESOLVE
+extern int gdImageColorResolve(gdImagePtr, int, int, int);
+#endif
+
/* number of fonts cached before least recently used is replaced */
#define FONTCACHESIZE 6
/* local prototype */
char *gdttfchar(gdImage *im, int fg, font_t *font, int x, int y, TT_F26Dot6 x1, TT_F26Dot6 y1, TT_F26Dot6 *advance, TT_BBox **bbox, char **next);
-#ifndef HAVE_GDIMAGECOLORRESOLVE
-
-int gdImageColorResolve(gdImagePtr im, int r, int g, int b);
-
-/********************************************************************/
-/* gdImageColorResolve is a replacement for the old fragment: */
-/* */
-/* if ((color=gdImageColorExact(im,R,G,B)) < 0) */
-/* if ((color=gdImageColorAllocate(im,R,G,B)) < 0) */
-/* color=gdImageColorClosest(im,R,G,B); */
-/* */
-/* in a single function */
-
-static int
-gdImageColorResolve(gdImagePtr im, int r, int g, int b)
-{
- int c;
- int ct = -1;
- int op = -1;
- long rd, gd, bd, dist;
- long mindist = 3*255*255; /* init to max poss dist */
-
- for (c = 0; c < im->colorsTotal; c++) {
- if (im->open[c]) {
- op = c; /* Save open slot */
- continue; /* Color not in use */
- }
- rd = (long)(im->red [c] - r);
- gd = (long)(im->green[c] - g);
- bd = (long)(im->blue [c] - b);
- dist = rd * rd + gd * gd + bd * bd;
- if (dist < mindist) {
- if (dist == 0) {
- return c; /* Return exact match color */
- }
- mindist = dist;
- ct = c;
- }
- }
- /* no exact match. We now know closest, but first try to allocate exact */
- if (op == -1) {
- op = im->colorsTotal;
- if (op == gdMaxColors) { /* No room for more colors */
- return ct; /* Return closest available color */
- }
- im->colorsTotal++;
- }
- im->red [op] = r;
- im->green[op] = g;
- im->blue [op] = b;
- im->open [op] = 0;
- return op; /* Return newly allocated color */
-}
-#endif
-
/********************************************************************
* gdTcl_UtfToUniChar is borrowed from ...
*/
extern PHP_MINIT_FUNCTION(gd);
extern PHP_MSHUTDOWN_FUNCTION(gd);
+#ifndef HAVE_GDIMAGECOLORRESOLVE
extern int gdImageColorResolve(gdImagePtr, int, int, int);
+#endif
PHP_FUNCTION(imagearc);
PHP_FUNCTION(imagechar);
PHP_FUNCTION(imagecharup);
PHP_FUNCTION(imagettfbbox);
PHP_FUNCTION(imagettftext);
#endif
+PHPAPI int phpi_get_le_gd(void);
#else
#define phpext_gd_ptr NULL
* ? Safe mode implementation
*/
-#if COMPILE_DL
-#include "dl/phpdl.h"
+#ifdef PIC
+# define COMPILE_DL 1
+#endif
+
+#ifdef COMPILE_DL
+# include "dl/phpdl.h"
#endif
#include "php.h"
#ifndef _PHP_MYSQL_H
#define _PHP_MYSQL_H
-#if COMPILE_DL
-#undef HAVE_MYSQL
-#define HAVE_MYSQL 1
+#ifdef COMPILE_DL
+# undef HAVE_MYSQL
+# define HAVE_MYSQL 1
#endif
#if WIN32||WINNT
#include "php.h"
-PHPAPI void php_output_startup();
+PHPAPI void php_output_startup(void);
PHPAPI int php_body_write(const char *str, uint str_length);
PHPAPI int php_header_write(const char *str, uint str_length);
-PHPAPI void php_start_ob_buffering();
+PHPAPI void php_start_ob_buffering(void);
PHPAPI void php_end_ob_buffering(int send_buffer);
extern zend_module_entry output_module_entry;
# define SLS_FETCH() sapi_globals_struct *sapi_globals = ts_resource(sapi_globals_id)
SAPI_API extern int sapi_globals_id;
#else
-# define SLS_D
+# define SLS_D void
# define SLS_DC
# define SLS_C
# define SLS_CC
SAPI_API void sapi_deactivate(SLS_D);
SAPI_API int sapi_add_header(char *header_line, uint header_line_len);
-SAPI_API int sapi_send_headers();
+SAPI_API int sapi_send_headers(void);
SAPI_API int sapi_register_post_readers(sapi_post_content_type_reader *post_content_type_readers);
SAPI_API int sapi_register_post_reader(sapi_post_content_type_reader *post_content_type_reader);
};
-int php_ini_mstartup();
-int php_ini_mshutdown();
-int php_ini_rshutdown();
+int php_ini_mstartup(void);
+int php_ini_mshutdown(void);
+int php_ini_rshutdown(void);
PHPAPI int php_register_ini_entries(php_ini_entry *ini_entry, int module_number);
PHPAPI void php_unregister_ini_entries(int module_number);
-PHPAPI void php_ini_refresh_caches();
+PHPAPI void php_ini_refresh_caches(void);
PHPAPI int php_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type);
PHPAPI int php_restore_ini_entry(char *name, uint name_length);
PHPAPI void display_ini_entries(zend_module_entry *module);
#include "php.h"
-PHPAPI void php_output_startup();
+PHPAPI void php_output_startup(void);
PHPAPI int php_body_write(const char *str, uint str_length);
PHPAPI int php_header_write(const char *str, uint str_length);
-PHPAPI void php_start_ob_buffering();
+PHPAPI void php_start_ob_buffering(void);
PHPAPI void php_end_ob_buffering(int send_buffer);
extern zend_module_entry output_module_entry;
PEAR - PHP Extension and Add-on Repository
- ------------------------------------------
+ ==========================================
+ Dedicated to Malin Bakken, born 1999-11-21
WHAT IS PEAR?