]> granicus.if.org Git - php/commitdiff
fix build when ext/hash is compiled as shared module
authorAntony Dovgal <tony2001@php.net>
Wed, 2 May 2007 10:30:24 +0000 (10:30 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 2 May 2007 10:30:24 +0000 (10:30 +0000)
ext/session/php_session.h
ext/session/session.c

index 0cd042d68b69103760c406b10c269935878cc90f..858208a321a494d276de0920e225a2751c817b35 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "ext/standard/php_var.h"
 
-#ifdef HAVE_HASH_EXT
+#if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH)
 # include "ext/hash/php_hash.h"
 #endif
 
@@ -125,7 +125,7 @@ typedef struct _php_ps_globals {
        zend_bool apply_trans_sid;      /* whether or not to enable trans-sid for the current request */
 
        long hash_func;
-#ifdef HAVE_HASH_EXT
+#if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH)
        php_hash_ops *hash_ops;
 #endif
        long hash_bits_per_character;
index 18357fec61fe019d9e64e071e5ef20d7219eb4c6..09408eb31488daa656d0fc3ca6ecd18d61f01b61 100644 (file)
@@ -265,7 +265,7 @@ PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS)
 {
        PHP_MD5_CTX md5_context;
        PHP_SHA1_CTX sha1_context;
-#ifdef HAVE_HASH_EXT
+#if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH)
        void *hash_context;
 #endif
        unsigned char *digest;
@@ -302,7 +302,7 @@ PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS)
                        PHP_SHA1Update(&sha1_context, (unsigned char *) buf, strlen(buf));
                        digest_len = 20;
                        break;
-#ifdef HAVE_HASH_EXT
+#if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH)
                case PS_HASH_FUNC_OTHER:
                        if (!PS(hash_ops)) {
                                php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid session hash function");
@@ -342,7 +342,7 @@ PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS)
                                        case PS_HASH_FUNC_SHA1:
                                                PHP_SHA1Update(&sha1_context, rbuf, n);
                                                break;
-#ifdef HAVE_HASH_EXT
+#if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH)
                                        case PS_HASH_FUNC_OTHER:
                                                PS(hash_ops)->hash_update(hash_context, rbuf, n);
                                                break;
@@ -362,7 +362,7 @@ PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS)
                case PS_HASH_FUNC_SHA1:
                        PHP_SHA1Final(digest, &sha1_context);
                        break;
-#ifdef HAVE_HASH_EXT
+#if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH)
                case PS_HASH_FUNC_OTHER:
                        PS(hash_ops)->hash_final(digest, hash_context);
                        efree(hash_context);
@@ -568,7 +568,7 @@ static PHP_INI_MH(OnUpdateHashFunc)
         long val;
        char *endptr = NULL;
 
-#ifdef HAVE_HASH_EXT
+#if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH)
        PS(hash_ops) = NULL;
 #endif
 
@@ -594,7 +594,7 @@ static PHP_INI_MH(OnUpdateHashFunc)
                return SUCCESS;
        }
 
-#ifdef HAVE_HASH_EXT
+#if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH)
 {
        php_hash_ops *ops = php_hash_fetch_ops(new_value, new_value_length);