]> granicus.if.org Git - php/commitdiff
Fix [-Wundef] warning in Tidy extension
authorGeorge Peter Banyard <girgias@php.net>
Tue, 12 May 2020 16:04:24 +0000 (18:04 +0200)
committerGeorge Peter Banyard <girgias@php.net>
Sun, 17 May 2020 22:37:18 +0000 (00:37 +0200)
ext/tidy/tidy.c
ext/tidy/tidy.stub.php
ext/tidy/tidy_arginfo.h

index b9f9c3502a03bcfd5f1f9c632f951c3194098782..7084883ecf257b4305590d5a7ea5cd643e3412c7 100644 (file)
 #include "php.h"
 #include "php_tidy.h"
 
-#if HAVE_TIDY
+#ifdef HAVE_TIDY
 
 #include "php_ini.h"
 #include "ext/standard/info.h"
 
-#if HAVE_TIDY_H
+#ifdef HAVE_TIDY_H
 #include "tidy.h"
-#elif HAVE_TIDYP_H
+#elif defined(HAVE_TIDYP_H)
 #include "tidyp.h"
 #endif
 
-#if HAVE_TIDYBUFFIO_H
+#ifdef HAVE_TIDYBUFFIO_H
 #include "tidybuffio.h"
 #else
 #include "buffio.h"
@@ -865,12 +865,12 @@ static PHP_MINFO_FUNCTION(tidy)
 {
        php_info_print_table_start();
        php_info_print_table_row(2, "Tidy support", "enabled");
-#if HAVE_TIDYBUFFIO_H
+#ifdef HAVE_TIDYBUFFIO_H
        php_info_print_table_row(2, "libTidy Version", (char *)tidyLibraryVersion());
-#elif HAVE_TIDYP_H
+#elif defined(HAVE_TIDYP_H)
        php_info_print_table_row(2, "libtidyp Version", (char *)tidyVersion());
 #endif
-#if HAVE_TIDYRELEASEDATE
+#ifdef HAVE_TIDYRELEASEDATE
        php_info_print_table_row(2, "libTidy Release", (char *)tidyReleaseDate());
 #endif
        php_info_print_table_end();
@@ -1139,7 +1139,7 @@ PHP_FUNCTION(tidy_get_release)
                RETURN_THROWS();
        }
 
-#if HAVE_TIDYRELEASEDATE
+#ifdef HAVE_TIDYRELEASEDATE
        RETURN_STRING((char *)tidyReleaseDate());
 #else
        RETURN_STRING((char *)"unknown");
@@ -1148,7 +1148,7 @@ PHP_FUNCTION(tidy_get_release)
 /* }}} */
 
 
-#if HAVE_TIDYOPTGETDOC
+#ifdef HAVE_TIDYOPTGETDOC
 /* {{{ proto string tidy_get_opt_doc(tidy resource, string optname)
    Returns the documentation for the given option name */
 PHP_FUNCTION(tidy_get_opt_doc)
@@ -1775,7 +1775,7 @@ static void _php_tidy_register_tags(INIT_FUNC_ARGS)
        TIDY_TAG_CONST(VAR);
        TIDY_TAG_CONST(WBR);
        TIDY_TAG_CONST(XMP);
-# if HAVE_TIDYBUFFIO_H
+# ifdef HAVE_TIDYBUFFIO_H
        TIDY_TAG_CONST(ARTICLE);
        TIDY_TAG_CONST(ASIDE);
        TIDY_TAG_CONST(AUDIO);
index 528fe425c91d8c130957f268e4d54a4733894630..fbb11adb9362aa6da6f9fbc9d0335d4a0a165c5b 100644 (file)
@@ -24,7 +24,7 @@ function tidy_diagnose(tidy $object): bool {}
 
 function tidy_get_release(): string {}
 
-#if HAVE_TIDYOPTGETDOC
+#ifdef HAVE_TIDYOPTGETDOC
 function tidy_get_opt_doc(tidy $object, string $optname): string|false {}
 #endif
 
@@ -129,7 +129,7 @@ class tidy
      */
     public function getHtmlVer() {}
 
-#if HAVE_TIDYOPTGETDOC
+#ifdef HAVE_TIDYOPTGETDOC
     /**
      * @return string|false
      * @alias tidy_get_opt_doc
index fca663d5a4881b077c853885a2f27da0244fcc20..84ecbb07d82d0dab24bdee3a8bb99d6b9e875103 100644 (file)
@@ -43,7 +43,7 @@ ZEND_END_ARG_INFO()
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_tidy_get_release, 0, 0, IS_STRING, 0)
 ZEND_END_ARG_INFO()
 
-#if HAVE_TIDYOPTGETDOC
+#if defined(HAVE_TIDYOPTGETDOC)
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_tidy_get_opt_doc, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
        ZEND_ARG_OBJ_INFO(0, object, tidy, 0)
        ZEND_ARG_TYPE_INFO(0, optname, IS_STRING, 0)
@@ -139,7 +139,7 @@ ZEND_END_ARG_INFO()
 
 #define arginfo_class_tidy_getHtmlVer arginfo_class_tidy_cleanRepair
 
-#if HAVE_TIDYOPTGETDOC
+#if defined(HAVE_TIDYOPTGETDOC)
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_tidy_getOptDoc, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, optname, IS_STRING, 0)
 ZEND_END_ARG_INFO()
@@ -189,7 +189,7 @@ ZEND_FUNCTION(tidy_repair_string);
 ZEND_FUNCTION(tidy_repair_file);
 ZEND_FUNCTION(tidy_diagnose);
 ZEND_FUNCTION(tidy_get_release);
-#if HAVE_TIDYOPTGETDOC
+#if defined(HAVE_TIDYOPTGETDOC)
 ZEND_FUNCTION(tidy_get_opt_doc);
 #endif
 ZEND_FUNCTION(tidy_get_config);
@@ -231,7 +231,7 @@ static const zend_function_entry ext_functions[] = {
        ZEND_FE(tidy_repair_file, arginfo_tidy_repair_file)
        ZEND_FE(tidy_diagnose, arginfo_tidy_diagnose)
        ZEND_FE(tidy_get_release, arginfo_tidy_get_release)
-#if HAVE_TIDYOPTGETDOC
+#if defined(HAVE_TIDYOPTGETDOC)
        ZEND_FE(tidy_get_opt_doc, arginfo_tidy_get_opt_doc)
 #endif
        ZEND_FE(tidy_get_config, arginfo_tidy_get_config)
@@ -265,7 +265,7 @@ static const zend_function_entry class_tidy_methods[] = {
        ZEND_ME_MAPPING(getConfig, tidy_get_config, arginfo_class_tidy_getConfig, ZEND_ACC_PUBLIC)
        ZEND_ME_MAPPING(getStatus, tidy_get_status, arginfo_class_tidy_getStatus, ZEND_ACC_PUBLIC)
        ZEND_ME_MAPPING(getHtmlVer, tidy_get_html_ver, arginfo_class_tidy_getHtmlVer, ZEND_ACC_PUBLIC)
-#if HAVE_TIDYOPTGETDOC
+#if defined(HAVE_TIDYOPTGETDOC)
        ZEND_ME_MAPPING(getOptDoc, tidy_get_opt_doc, arginfo_class_tidy_getOptDoc, ZEND_ACC_PUBLIC)
 #endif
        ZEND_ME_MAPPING(isXhtml, tidy_is_xhtml, arginfo_class_tidy_isXhtml, ZEND_ACC_PUBLIC)