Show
Ignore:
Timestamp:
05/05/05 10:53:05 (4 years ago)
Author:
zoeloelip
Message:

This patch fixes some stuff concerning configuration. With this patch some parts that are forgotten with the
code split are fixed. They are also needed to compile eA with VC.
The other stuff make it possible to compile eA as a static module for php.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/trunk/eaccelerator.h

    r64 r73  
    4545#endif 
    4646 
    47 #ifndef ZEND_WIN32 
     47#if !defined(ZEND_WIN32) && defined(HAVE_CONFIG_H) 
    4848#  if ZEND_MODULE_API_NO >= 20001222 
    4949#    include "config.h" 
     
    5151#    include "php_config.h" 
    5252#  endif 
     53#endif 
     54 
     55/* needed to compile eA as a static php module */ 
     56extern zend_module_entry eaccelerator_module_entry; 
     57#define phpext_eaccelerator_ptr &eaccelerator_module_entry 
     58 
     59/* fixes compile errors on php5.1 */ 
     60#ifdef STR_EMPTY_ALLOC 
     61#define empty_string STR_EMPTY_ALLOC() 
    5362#endif 
    5463 
     
    8998#  ifndef ZEND_WIN32 
    9099#    ifdef HAVE_FLOCK 
     100#          include <sys/file.h> 
    91101#      define EACCELERATOR_FLOCK(FILE,OP) flock((FILE),(OP)) 
    92102#    else 
     
    119129#endif 
    120130 
     131#ifdef ZEND_WIN32 
     132#  include <process.h> 
     133#  ifndef S_ISREG 
     134#    define S_ISREG(mode) (((mode)&S_IFMT) & S_IFREG) 
     135#  endif 
     136#  ifndef S_IRUSR 
     137#    define S_IRUSR S_IREAD 
     138#  endif 
     139#  ifndef S_IWUSR 
     140#    define S_IWUSR S_IWRITE 
     141#  endif 
     142#else 
     143#  include <dirent.h> 
     144#endif 
     145 
    121146#ifdef ZTS 
    122147#  define ZTS_LOCK()    tsrm_mutex_lock(mm_mutex) 
     
    164189#define MAX_DUP_STR_LEN 256 
    165190 
    166 #define offsetof(str,fld) ((size_t)&(((str*)NULL)->fld)) 
     191#ifndef offsetof 
     192#  define offsetof(str,fld) ((size_t)&(((str*)NULL)->fld)) 
     193#endif 
    167194 
    168195#define EACCELERATOR_EXTENSION_NAME "eAccelerator" 
     
    377404} mm_cond_entry; 
    378405 
     406typedef union align_union { 
     407  double d; 
     408  void *v; 
     409  int (*func)(int); 
     410  long l; 
     411} align_union; 
     412 
    379413/******************************************************************************/ 
     414 
     415#ifdef ZTS 
     416MUTEX_T mm_mutex; 
     417#endif 
    380418 
    381419void format_size (char *s, unsigned int size, int legend);