@Fix some warnings when compiling in maintainer-mode (Stig)

@Made mysql and gd work as shared extensions again (Stig)
- Fixed some warnings in maintainer-mode.
- Made mysql and gd work as shared extensions again by defining
  COMPILE_DL if PIC is defined.
# We need a better solution for building .so extensions than this
# PIC/COMPILE_DL hack!
This commit is contained in:
Stig Bakken 1999-12-01 22:59:45 +00:00
parent 93536507f6
commit 2467dd6d05
11 changed files with 34 additions and 79 deletions

View File

@ -662,10 +662,8 @@ PHP_REGEX
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

View File

@ -25,6 +25,10 @@
/* 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>
@ -136,11 +140,7 @@ php3_module_entry gd_module_entry = {
};
#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

View File

@ -23,6 +23,10 @@
#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
@ -149,61 +153,6 @@ static void bitmapRelease( void *element );
/* 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 ...
*/

View File

@ -57,7 +57,9 @@ PHP_MINFO_FUNCTION(gd);
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);
@ -102,6 +104,7 @@ PHP_FUNCTION(imagedashedline);
PHP_FUNCTION(imagettfbbox);
PHP_FUNCTION(imagettftext);
#endif
PHPAPI int phpi_get_le_gd(void);
#else
#define phpext_gd_ptr NULL

View File

@ -24,8 +24,12 @@
* ? 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"

View File

@ -22,9 +22,9 @@
#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

View File

@ -22,10 +22,10 @@
#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;

View File

@ -96,7 +96,7 @@ typedef struct {
# 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
@ -117,7 +117,7 @@ SAPI_API void sapi_activate(SLS_D);
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);

View File

@ -51,13 +51,13 @@ struct _php_ini_entry {
};
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);

View File

@ -22,10 +22,10 @@
#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;

View File

@ -1,5 +1,6 @@
PEAR - PHP Extension and Add-on Repository
------------------------------------------
==========================================
Dedicated to Malin Bakken, born 1999-11-21
WHAT IS PEAR?