]> granicus.if.org Git - php/commitdiff
Fix [-Wundef] warning in PDO DBLib extension
authorGeorge Peter Banyard <girgias@php.net>
Wed, 20 May 2020 13:40:57 +0000 (15:40 +0200)
committerGeorge Peter Banyard <girgias@php.net>
Wed, 20 May 2020 14:29:52 +0000 (16:29 +0200)
ext/pdo_dblib/dblib_driver.c
ext/pdo_dblib/dblib_stmt.c
ext/pdo_dblib/pdo_dblib.c
ext/pdo_dblib/php_pdo_dblib.h
ext/pdo_dblib/php_pdo_dblib_int.h

index 85473c2ac14c4c223fc4a975a0816e9d114c112a..7f160a402f7e23b2fb23b60693cd2bab0a6e480c 100644 (file)
@@ -539,7 +539,7 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options)
                }
        }
 
-#if !PHP_DBLIB_IS_MSSQL
+#ifndef PHP_DBLIB_IS_MSSQL
        if (vars[0].optval) {
                DBSETLCHARSET(H->login, vars[0].optval);
        }
@@ -570,7 +570,7 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options)
        }
 #endif
 
-#if PHP_DBLIB_IS_MSSQL
+#ifdef PHP_DBLIB_IS_MSSQL
        /* dblib do not return more than this length from text/image */
        DBSETOPT(H->link, DBTEXTLIMIT, "2147483647");
 #endif
@@ -607,7 +607,7 @@ cleanup:
 }
 
 const pdo_driver_t pdo_dblib_driver = {
-#if PDO_DBLIB_IS_MSSQL
+#ifdef PDO_DBLIB_IS_MSSQL
        PDO_DRIVER_HEADER(mssql),
 #elif defined(PHP_WIN32)
 #define PDO_DBLIB_IS_SYBASE
index d8608c1d461a849ea561f0763653fed5f05b1c4e..94526a4c6ea6c23c979d713f147e88def0fccc4b 100644 (file)
@@ -373,7 +373,7 @@ static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr,
                                case SQLCHAR:
                                case SQLVARCHAR:
                                case SQLTEXT: {
-#if ilia_0
+#ifdef ilia_0
                                        while (data_len>0 && data[data_len-1] == ' ') { /* nuke trailing whitespace */
                                                data_len--;
                                        }
index d5670cc86f05abb0e330e1d7713865cfe5690f02..b36175b9ca254901260f83acbb72861f9fcc728c 100644 (file)
@@ -40,14 +40,14 @@ static const zend_module_dep pdo_dblib_deps[] = {
        ZEND_MOD_END
 };
 
-#if PDO_DBLIB_IS_MSSQL
+#ifdef PDO_DBLIB_IS_MSSQL
 zend_module_entry pdo_mssql_module_entry = {
 #else
 zend_module_entry pdo_dblib_module_entry = {
 #endif
        STANDARD_MODULE_HEADER_EX, NULL,
        pdo_dblib_deps,
-#if PDO_DBLIB_IS_MSSQL
+#ifdef PDO_DBLIB_IS_MSSQL
        "pdo_mssql",
 #elif defined(PHP_WIN32)
        "pdo_sybase",
@@ -72,7 +72,7 @@ zend_module_entry pdo_dblib_module_entry = {
 #ifdef ZTS
 ZEND_TSRMLS_CACHE_DEFINE()
 #endif
-#if PDO_DBLIB_IS_MSSQL
+#ifdef PDO_DBLIB_IS_MSSQL
 ZEND_GET_MODULE(pdo_mssql)
 #else
 ZEND_GET_MODULE(pdo_dblib)
@@ -209,7 +209,7 @@ PHP_MINIT_FUNCTION(pdo_dblib)
                return FAILURE;
        }
 
-#if !PHP_DBLIB_IS_MSSQL
+#ifndef PHP_DBLIB_IS_MSSQL
        dberrhandle((EHANDLEFUNC) pdo_dblib_error_handler);
        dbmsghandle((MHANDLEFUNC) pdo_dblib_msg_handler);
 #endif
@@ -228,7 +228,7 @@ PHP_MINFO_FUNCTION(pdo_dblib)
 {
        php_info_print_table_start();
        php_info_print_table_header(2, "PDO Driver for "
-#if PDO_DBLIB_IS_MSSQL
+#ifdef PDO_DBLIB_IS_MSSQL
                "MSSQL"
 #elif defined(PHP_WIN32)
                "FreeTDS/Sybase/MSSQL"
index af4e845624c680127a4c78137a46c825df59e25c..0fe9a422982dbc832756e08c85122bf7f7ba2209 100644 (file)
@@ -18,7 +18,7 @@
 #ifndef PHP_PDO_DBLIB_H
 #define PHP_PDO_DBLIB_H
 
-#if PDO_DBLIB_IS_MSSQL
+#ifdef PDO_DBLIB_IS_MSSQL
 extern zend_module_entry pdo_mssql_module_entry;
 #define phpext_pdo_mssql_ptr &pdo_mssql_module_entry
 #else
index ed82ada40e47a2d13b726a7e226f7ed949c797f2..ecd65f577c66a553042dc76dce890d1f0f3f9e4c 100644 (file)
@@ -22,7 +22,7 @@
 # define PDO_DBLIB_FLAVOUR "Generic DB-lib"
 #endif
 
-#if PHP_DBLIB_IS_MSSQL
+#ifdef PHP_DBLIB_IS_MSSQL
 # include <sqlfront.h>
 # include <sqldb.h>