Skip to content

Commit a7b592e

Browse files
committed
Fix [-Wundef] warning in Tidy extension
1 parent 4edb186 commit a7b592e

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

ext/tidy/tidy.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@
2121
#include "php.h"
2222
#include "php_tidy.h"
2323

24-
#if HAVE_TIDY
24+
#ifdef HAVE_TIDY
2525

2626
#include "php_ini.h"
2727
#include "ext/standard/info.h"
2828

29-
#if HAVE_TIDY_H
29+
#ifdef HAVE_TIDY_H
3030
#include "tidy.h"
31-
#elif HAVE_TIDYP_H
31+
#elif defined(HAVE_TIDYP_H)
3232
#include "tidyp.h"
3333
#endif
3434

35-
#if HAVE_TIDYBUFFIO_H
35+
#ifdef HAVE_TIDYBUFFIO_H
3636
#include "tidybuffio.h"
3737
#else
3838
#include "buffio.h"
@@ -865,12 +865,12 @@ static PHP_MINFO_FUNCTION(tidy)
865865
{
866866
php_info_print_table_start();
867867
php_info_print_table_row(2, "Tidy support", "enabled");
868-
#if HAVE_TIDYBUFFIO_H
868+
#ifdef HAVE_TIDYBUFFIO_H
869869
php_info_print_table_row(2, "libTidy Version", (char *)tidyLibraryVersion());
870-
#elif HAVE_TIDYP_H
870+
#elif defined(HAVE_TIDYP_H)
871871
php_info_print_table_row(2, "libtidyp Version", (char *)tidyVersion());
872872
#endif
873-
#if HAVE_TIDYRELEASEDATE
873+
#ifdef HAVE_TIDYRELEASEDATE
874874
php_info_print_table_row(2, "libTidy Release", (char *)tidyReleaseDate());
875875
#endif
876876
php_info_print_table_end();
@@ -1139,7 +1139,7 @@ PHP_FUNCTION(tidy_get_release)
11391139
RETURN_THROWS();
11401140
}
11411141

1142-
#if HAVE_TIDYRELEASEDATE
1142+
#ifdef HAVE_TIDYRELEASEDATE
11431143
RETURN_STRING((char *)tidyReleaseDate());
11441144
#else
11451145
RETURN_STRING((char *)"unknown");
@@ -1148,7 +1148,7 @@ PHP_FUNCTION(tidy_get_release)
11481148
/* }}} */
11491149

11501150

1151-
#if HAVE_TIDYOPTGETDOC
1151+
#ifdef HAVE_TIDYOPTGETDOC
11521152
/* {{{ proto string tidy_get_opt_doc(tidy resource, string optname)
11531153
Returns the documentation for the given option name */
11541154
PHP_FUNCTION(tidy_get_opt_doc)
@@ -1775,7 +1775,7 @@ static void _php_tidy_register_tags(INIT_FUNC_ARGS)
17751775
TIDY_TAG_CONST(VAR);
17761776
TIDY_TAG_CONST(WBR);
17771777
TIDY_TAG_CONST(XMP);
1778-
# if HAVE_TIDYBUFFIO_H
1778+
# ifdef HAVE_TIDYBUFFIO_H
17791779
TIDY_TAG_CONST(ARTICLE);
17801780
TIDY_TAG_CONST(ASIDE);
17811781
TIDY_TAG_CONST(AUDIO);

ext/tidy/tidy.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function tidy_diagnose(tidy $object): bool {}
2424

2525
function tidy_get_release(): string {}
2626

27-
#if HAVE_TIDYOPTGETDOC
27+
#ifdef HAVE_TIDYOPTGETDOC
2828
function tidy_get_opt_doc(tidy $object, string $optname): string|false {}
2929
#endif
3030

@@ -129,7 +129,7 @@ public function getStatus() {}
129129
*/
130130
public function getHtmlVer() {}
131131

132-
#if HAVE_TIDYOPTGETDOC
132+
#ifdef HAVE_TIDYOPTGETDOC
133133
/**
134134
* @return string|false
135135
* @alias tidy_get_opt_doc

ext/tidy/tidy_arginfo.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ ZEND_END_ARG_INFO()
4343
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_tidy_get_release, 0, 0, IS_STRING, 0)
4444
ZEND_END_ARG_INFO()
4545

46-
#if HAVE_TIDYOPTGETDOC
46+
#if defined(HAVE_TIDYOPTGETDOC)
4747
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_tidy_get_opt_doc, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
4848
ZEND_ARG_OBJ_INFO(0, object, tidy, 0)
4949
ZEND_ARG_TYPE_INFO(0, optname, IS_STRING, 0)
@@ -139,7 +139,7 @@ ZEND_END_ARG_INFO()
139139

140140
#define arginfo_class_tidy_getHtmlVer arginfo_class_tidy_cleanRepair
141141

142-
#if HAVE_TIDYOPTGETDOC
142+
#if defined(HAVE_TIDYOPTGETDOC)
143143
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_tidy_getOptDoc, 0, 0, 1)
144144
ZEND_ARG_TYPE_INFO(0, optname, IS_STRING, 0)
145145
ZEND_END_ARG_INFO()
@@ -189,7 +189,7 @@ ZEND_FUNCTION(tidy_repair_string);
189189
ZEND_FUNCTION(tidy_repair_file);
190190
ZEND_FUNCTION(tidy_diagnose);
191191
ZEND_FUNCTION(tidy_get_release);
192-
#if HAVE_TIDYOPTGETDOC
192+
#if defined(HAVE_TIDYOPTGETDOC)
193193
ZEND_FUNCTION(tidy_get_opt_doc);
194194
#endif
195195
ZEND_FUNCTION(tidy_get_config);
@@ -231,7 +231,7 @@ static const zend_function_entry ext_functions[] = {
231231
ZEND_FE(tidy_repair_file, arginfo_tidy_repair_file)
232232
ZEND_FE(tidy_diagnose, arginfo_tidy_diagnose)
233233
ZEND_FE(tidy_get_release, arginfo_tidy_get_release)
234-
#if HAVE_TIDYOPTGETDOC
234+
#if defined(HAVE_TIDYOPTGETDOC)
235235
ZEND_FE(tidy_get_opt_doc, arginfo_tidy_get_opt_doc)
236236
#endif
237237
ZEND_FE(tidy_get_config, arginfo_tidy_get_config)
@@ -265,7 +265,7 @@ static const zend_function_entry class_tidy_methods[] = {
265265
ZEND_ME_MAPPING(getConfig, tidy_get_config, arginfo_class_tidy_getConfig, ZEND_ACC_PUBLIC)
266266
ZEND_ME_MAPPING(getStatus, tidy_get_status, arginfo_class_tidy_getStatus, ZEND_ACC_PUBLIC)
267267
ZEND_ME_MAPPING(getHtmlVer, tidy_get_html_ver, arginfo_class_tidy_getHtmlVer, ZEND_ACC_PUBLIC)
268-
#if HAVE_TIDYOPTGETDOC
268+
#if defined(HAVE_TIDYOPTGETDOC)
269269
ZEND_ME_MAPPING(getOptDoc, tidy_get_opt_doc, arginfo_class_tidy_getOptDoc, ZEND_ACC_PUBLIC)
270270
#endif
271271
ZEND_ME_MAPPING(isXhtml, tidy_is_xhtml, arginfo_class_tidy_isXhtml, ZEND_ACC_PUBLIC)

0 commit comments

Comments
 (0)