johannes                Sat Feb  9 21:58:39 2008 UTC

  Modified files:              
    /php-src/ext/ldap   ldap.c 
  Log:
  Fix build on Solaris
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/ldap.c?r1=1.179&r2=1.180&diff_format=u
Index: php-src/ext/ldap/ldap.c
diff -u php-src/ext/ldap/ldap.c:1.179 php-src/ext/ldap/ldap.c:1.180
--- php-src/ext/ldap/ldap.c:1.179       Mon Dec 31 07:12:10 2007
+++ php-src/ext/ldap/ldap.c     Sat Feb  9 21:58:39 2008
@@ -23,7 +23,7 @@
    +----------------------------------------------------------------------+
  */
  
-/* $Id: ldap.c,v 1.179 2007/12/31 07:12:10 sebastian Exp $ */
+/* $Id: ldap.c,v 1.180 2008/02/09 21:58:39 johannes Exp $ */
 #define IS_EXT_MODULE
 
 #ifdef HAVE_CONFIG_H
@@ -327,7 +327,7 @@
 
        php_info_print_table_start();
        php_info_print_table_row(2, "LDAP Support", "enabled");
-       php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.179 
2007/12/31 07:12:10 sebastian Exp $");
+       php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.180 
2008/02/09 21:58:39 johannes Exp $");
 
        if (LDAPG(max_links) == -1) {
                snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links));
@@ -1726,10 +1726,9 @@
                        zval_dtor(*retval);
                        ZVAL_LONG(*retval, val);
                } break;
-#if defined(LDAP_OPT_NETWORK_TIMEOUT) || defined(LDAP_X_OPT_CONNECT_TIMEOUT)
+#ifdef LDAP_OPT_NETWORK_TIMEOUT
        case LDAP_OPT_NETWORK_TIMEOUT:
                {
-# ifdef LDAP_OPT_NETWORK_TIMEOUT
                        struct timeval *timeout;
 
                        if (ldap_get_option(ld->link, LDAP_OPT_NETWORK_TIMEOUT, 
(void *) &timeout)) {
@@ -1741,7 +1740,10 @@
                        zval_dtor(*retval);
                        ZVAL_LONG(*retval, timeout->tv_sec);
                        ldap_memfree(timeout);
-# elif defined(LDAP_X_OPT_CONNECT_TIMEOUT)
+               } break;
+#elif defined(LDAP_X_OPT_CONNECT_TIMEOUT)
+       case LDAP_X_OPT_CONNECT_TIMEOUT:
+               {
                        int timeout;
 
                        if (ldap_get_option(ld->link, 
LDAP_X_OPT_CONNECT_TIMEOUT, &timeout)) {
@@ -1749,7 +1751,6 @@
                        }                       
                        zval_dtor(*retval);
                        ZVAL_LONG(*retval, (timeout / 1000));
-# endif
                } break;
 #endif
        /* options with string value */
@@ -1834,10 +1835,9 @@
                                RETURN_FALSE;
                        }
                } break;
-#if defined(LDAP_OPT_NETWORK_TIMEOUT) || defined(LDAP_X_OPT_CONNECT_TIMEOUT)
+#ifdef LDAP_OPT_NETWORK_TIMEOUT
        case LDAP_OPT_NETWORK_TIMEOUT:
                {
-# ifdef LDAP_OPT_NETWORK_TIMEOUT
                        struct timeval timeout;
 
                        convert_to_long_ex(newval);
@@ -1846,15 +1846,17 @@
                        if (ldap_set_option(ldap, LDAP_OPT_NETWORK_TIMEOUT, 
(void *) &timeout)) {
                                RETURN_FALSE;
                        }                       
-# elif defined(LDAP_X_OPT_CONNECT_TIMEOUT)
+               } break;
+#elif defined(LDAP_X_OPT_CONNECT_TIMEOUT)
+       case LDAP_X_OPT_CONNECT_TIMEOUT:
+               {
                        int timeout;
 
                        convert_to_long_ex(newval);
-                       timeou = 1000 * Z_LVAL_PP(newval); /* Convert to 
milliseconds */
+                       timeout = 1000 * Z_LVAL_PP(newval); /* Convert to 
milliseconds */
                        if (ldap_set_option(ldap, LDAP_X_OPT_CONNECT_TIMEOUT, 
&timeout)) {
                                RETURN_FALSE;
                        }                       
-# endif
                } break;
 #endif
                /* options with string value */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to