X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_cache_api.h;h=3c2e7834321ff727d8952c33f57fdf002b520342;hp=5bd727e5faaae7b5c5c1e88b094ed732299ab350;hb=fb5d0ef47f1f54dad0efa1f091324e3d7d18050b;hpb=1ec34f462819d4a10badd83d8493403b6c0c6e68;ds=sidebyside diff --git a/php_http_cache_api.h b/php_http_cache_api.h index 5bd727e..3c2e783 100644 --- a/php_http_cache_api.h +++ b/php_http_cache_api.h @@ -20,16 +20,12 @@ #include "ext/standard/crc32.h" #include "ext/standard/sha1.h" #include "ext/standard/md5.h" -#if HTTP_HAVE_EXT(HASH) -# if defined(HTTP_HAVE_EXT_HASH) -# include "php_hash.h" -# elif defined(HTTP_HAVE_HASH_EXT_HASH) -# define HTTP_HAVE_EXT_HASH -# include "hash/php_hash.h" -# elif defined(HTTP_HAVE_EXT_HASH_EXT_HASH) -# define HTTP_HAVE_EXT_HASH -# include "ext/hash/php_hash.h" -# endif + +#if defined(HTTP_HAVE_PHP_HASH_H) && HTTP_HAVE_EXT(HASH) +# define HTTP_HAVE_EXT_HASH 1 +# include "php_hash.h" +#else +# define HTTP_HAVE_EXT_HASH 0 #endif #define http_etag_digest(d, l) _http_etag_digest((d), (l)) @@ -55,7 +51,7 @@ static inline void *_http_etag_init(TSRMLS_D) void *ctx = NULL; char *mode = HTTP_G->etag.mode; -#if HTTP_HAVE_EXT(HASH) +#if HTTP_HAVE_EXT_HASH php_hash_ops *eho = NULL; if (mode && (eho = php_hash_fetch_ops(mode, strlen(mode)))) { @@ -81,7 +77,7 @@ static inline char *_http_etag_finish(void *ctx TSRMLS_DC) unsigned char digest[128] = {0}; char *etag = NULL, *mode = HTTP_G->etag.mode; -#if HTTP_HAVE_EXT(HASH) +#if HTTP_HAVE_EXT_HASH php_hash_ops *eho = NULL; if (mode && (eho = php_hash_fetch_ops(mode, strlen(mode)))) { @@ -108,7 +104,7 @@ static inline char *_http_etag_finish(void *ctx TSRMLS_DC) static inline void _http_etag_update(void *ctx, const char *data_ptr, size_t data_len TSRMLS_DC) { char *mode = HTTP_G->etag.mode; -#if HTTP_HAVE_EXT(HASH) +#if HTTP_HAVE_EXT_HASH php_hash_ops *eho = NULL; if (mode && (eho = php_hash_fetch_ops(mode, strlen(mode)))) {