summaryrefslogtreecommitdiff
path: root/ext/dom
diff options
context:
space:
mode:
authorGeorge Peter Banyard <girgias@php.net>2020-05-12 22:54:43 +0200
committerGeorge Peter Banyard <girgias@php.net>2020-05-16 15:31:15 +0200
commit62b1d2cb69dddfbc752b6a684d94bb520742a851 (patch)
tree51e8a204c3dc103e194917872c40592859e945ee /ext/dom
parent93b51f4e26c5615b1218f8bc3c5d6a5ef2a94b18 (diff)
downloadphp-git-62b1d2cb69dddfbc752b6a684d94bb520742a851.tar.gz
Fix [-Wundef] warning in DOM extension
Diffstat (limited to 'ext/dom')
-rw-r--r--ext/dom/attr.c2
-rw-r--r--ext/dom/cdatasection.c2
-rw-r--r--ext/dom/characterdata.c2
-rw-r--r--ext/dom/comment.c2
-rw-r--r--ext/dom/document.c10
-rw-r--r--ext/dom/documentfragment.c2
-rw-r--r--ext/dom/documenttype.c2
-rw-r--r--ext/dom/dom_ce.h2
-rw-r--r--ext/dom/dom_iterators.c2
-rw-r--r--ext/dom/dom_properties.h2
-rw-r--r--ext/dom/domexception.c2
-rw-r--r--ext/dom/domimplementation.c2
-rw-r--r--ext/dom/element.c2
-rw-r--r--ext/dom/entity.c2
-rw-r--r--ext/dom/entityreference.c2
-rw-r--r--ext/dom/namednodemap.c2
-rw-r--r--ext/dom/node.c2
-rw-r--r--ext/dom/nodelist.c2
-rw-r--r--ext/dom/notation.c2
-rw-r--r--ext/dom/parentnode.c2
-rw-r--r--ext/dom/php_dom.c24
-rw-r--r--ext/dom/php_dom.h8
-rw-r--r--ext/dom/php_dom.stub.php6
-rw-r--r--ext/dom/processinginstruction.c2
-rw-r--r--ext/dom/text.c2
-rw-r--r--ext/dom/xpath.c4
26 files changed, 47 insertions, 47 deletions
diff --git a/ext/dom/attr.c b/ext/dom/attr.c
index f6612e791a..a89cce5750 100644
--- a/ext/dom/attr.c
+++ b/ext/dom/attr.c
@@ -21,7 +21,7 @@
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
diff --git a/ext/dom/cdatasection.c b/ext/dom/cdatasection.c
index bd02af7042..72bf77a04f 100644
--- a/ext/dom/cdatasection.c
+++ b/ext/dom/cdatasection.c
@@ -20,7 +20,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*
diff --git a/ext/dom/characterdata.c b/ext/dom/characterdata.c
index ef458460f6..b43636a8a4 100644
--- a/ext/dom/characterdata.c
+++ b/ext/dom/characterdata.c
@@ -20,7 +20,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*
diff --git a/ext/dom/comment.c b/ext/dom/comment.c
index 32d6271c38..44cde90166 100644
--- a/ext/dom/comment.c
+++ b/ext/dom/comment.c
@@ -20,7 +20,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*
diff --git a/ext/dom/document.c b/ext/dom/document.c
index 919c594086..e355e0f134 100644
--- a/ext/dom/document.c
+++ b/ext/dom/document.c
@@ -20,7 +20,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
#include <libxml/SAX.h>
#ifdef LIBXML_SCHEMAS_ENABLED
@@ -1225,9 +1225,9 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, size_t so
/* If loading from memory, we need to set the base directory for the document */
if (mode != DOM_LOAD_FILE) {
-#if HAVE_GETCWD
+#ifdef HAVE_GETCWD
directory = VCWD_GETCWD(resolved_path, MAXPATHLEN);
-#elif HAVE_GETWD
+#elif defined(HAVE_GETWD)
directory = VCWD_GETWD(resolved_path);
#endif
if (directory) {
@@ -1621,7 +1621,7 @@ PHP_METHOD(DOMDocument, validate)
}
/* }}} */
-#if defined(LIBXML_SCHEMAS_ENABLED)
+#ifdef LIBXML_SCHEMAS_ENABLED
static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
{
zval *id;
@@ -1819,7 +1819,7 @@ PHP_METHOD(DOMDocument, relaxNGValidateSource)
#endif
-#if defined(LIBXML_HTML_ENABLED)
+#ifdef LIBXML_HTML_ENABLED
static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
{
diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c
index bdef339636..14cdaf1d21 100644
--- a/ext/dom/documentfragment.c
+++ b/ext/dom/documentfragment.c
@@ -20,7 +20,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*
diff --git a/ext/dom/documenttype.c b/ext/dom/documenttype.c
index 1e7857a648..e910cf4009 100644
--- a/ext/dom/documenttype.c
+++ b/ext/dom/documenttype.c
@@ -20,7 +20,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/* {{{ name string
diff --git a/ext/dom/dom_ce.h b/ext/dom/dom_ce.h
index 4fea77b8e2..784012bf59 100644
--- a/ext/dom/dom_ce.h
+++ b/ext/dom/dom_ce.h
@@ -36,7 +36,7 @@ extern PHP_DOM_EXPORT zend_class_entry *dom_notation_class_entry;
extern PHP_DOM_EXPORT zend_class_entry *dom_entity_class_entry;
extern PHP_DOM_EXPORT zend_class_entry *dom_entityreference_class_entry;
extern PHP_DOM_EXPORT zend_class_entry *dom_processinginstruction_class_entry;
-#if defined(LIBXML_XPATH_ENABLED)
+#ifdef LIBXML_XPATH_ENABLED
extern PHP_DOM_EXPORT zend_class_entry *dom_xpath_class_entry;
#endif
extern PHP_DOM_EXPORT zend_class_entry *dom_namespace_node_class_entry;
diff --git a/ext/dom/dom_iterators.c b/ext/dom/dom_iterators.c
index 6a89861107..bd83114bd9 100644
--- a/ext/dom/dom_iterators.c
+++ b/ext/dom/dom_iterators.c
@@ -20,7 +20,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
#include "dom_ce.h"
diff --git a/ext/dom/dom_properties.h b/ext/dom/dom_properties.h
index b4b0401356..f972bffe96 100644
--- a/ext/dom/dom_properties.h
+++ b/ext/dom/dom_properties.h
@@ -132,7 +132,7 @@ int dom_processinginstruction_data_write(dom_object *obj, zval *newval);
/* text properties */
int dom_text_whole_text_read(dom_object *obj, zval *retval);
-#if defined(LIBXML_XPATH_ENABLED)
+#ifdef LIBXML_XPATH_ENABLED
/* xpath properties */
int dom_xpath_document_read(dom_object *obj, zval *retval);
int dom_xpath_register_node_ns_read(dom_object *obj, zval *retval);
diff --git a/ext/dom/domexception.c b/ext/dom/domexception.c
index f0f5e7d765..0fb4d57c04 100644
--- a/ext/dom/domexception.c
+++ b/ext/dom/domexception.c
@@ -20,7 +20,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*
diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c
index c5492356fb..1dfe95ab61 100644
--- a/ext/dom/domimplementation.c
+++ b/ext/dom/domimplementation.c
@@ -20,7 +20,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*
diff --git a/ext/dom/element.c b/ext/dom/element.c
index c76592a72a..cd67e214a5 100644
--- a/ext/dom/element.c
+++ b/ext/dom/element.c
@@ -20,7 +20,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*
diff --git a/ext/dom/entity.c b/ext/dom/entity.c
index d00a969c08..7ad43a1ee3 100644
--- a/ext/dom/entity.c
+++ b/ext/dom/entity.c
@@ -20,7 +20,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
diff --git a/ext/dom/entityreference.c b/ext/dom/entityreference.c
index 3b8f2dac94..370d4510ce 100644
--- a/ext/dom/entityreference.c
+++ b/ext/dom/entityreference.c
@@ -20,7 +20,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*
diff --git a/ext/dom/namednodemap.c b/ext/dom/namednodemap.c
index 9e322d8edd..18775d7ef1 100644
--- a/ext/dom/namednodemap.c
+++ b/ext/dom/namednodemap.c
@@ -20,7 +20,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*
diff --git a/ext/dom/node.c b/ext/dom/node.c
index fe09c1c940..f2da0d92b7 100644
--- a/ext/dom/node.c
+++ b/ext/dom/node.c
@@ -20,7 +20,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*
diff --git a/ext/dom/nodelist.c b/ext/dom/nodelist.c
index d6845c32ad..502c75d0aa 100644
--- a/ext/dom/nodelist.c
+++ b/ext/dom/nodelist.c
@@ -20,7 +20,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*
diff --git a/ext/dom/notation.c b/ext/dom/notation.c
index 468bbad4e0..f1e0c1ba38 100644
--- a/ext/dom/notation.c
+++ b/ext/dom/notation.c
@@ -20,7 +20,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*
diff --git a/ext/dom/parentnode.c b/ext/dom/parentnode.c
index 76263918be..a7627cb84c 100644
--- a/ext/dom/parentnode.c
+++ b/ext/dom/parentnode.c
@@ -21,7 +21,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/* {{{ firstElementChild DomParentNode
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c
index c7b2103a0f..9dc50ac287 100644
--- a/ext/dom/php_dom.c
+++ b/ext/dom/php_dom.c
@@ -21,7 +21,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "ext/standard/php_rand.h"
#include "php_dom.h"
#include "php_dom_arginfo.h"
@@ -53,7 +53,7 @@ PHP_DOM_EXPORT zend_class_entry *dom_notation_class_entry;
PHP_DOM_EXPORT zend_class_entry *dom_entity_class_entry;
PHP_DOM_EXPORT zend_class_entry *dom_entityreference_class_entry;
PHP_DOM_EXPORT zend_class_entry *dom_processinginstruction_class_entry;
-#if defined(LIBXML_XPATH_ENABLED)
+#ifdef LIBXML_XPATH_ENABLED
PHP_DOM_EXPORT zend_class_entry *dom_xpath_class_entry;
#endif
PHP_DOM_EXPORT zend_class_entry *dom_namespace_node_class_entry;
@@ -61,7 +61,7 @@ PHP_DOM_EXPORT zend_class_entry *dom_namespace_node_class_entry;
zend_object_handlers dom_object_handlers;
zend_object_handlers dom_nnodemap_object_handlers;
-#if defined(LIBXML_XPATH_ENABLED)
+#ifdef LIBXML_XPATH_ENABLED
zend_object_handlers dom_xpath_object_handlers;
#endif
@@ -81,7 +81,7 @@ static HashTable dom_notation_prop_handlers;
static HashTable dom_entity_prop_handlers;
static HashTable dom_processinginstruction_prop_handlers;
static HashTable dom_namespace_node_prop_handlers;
-#if defined(LIBXML_XPATH_ENABLED)
+#ifdef LIBXML_XPATH_ENABLED
static HashTable dom_xpath_prop_handlers;
#endif
/* }}} */
@@ -551,7 +551,7 @@ static zval *dom_nodelist_read_dimension(zend_object *object, zval *offset, int
static int dom_nodelist_has_dimension(zend_object *object, zval *member, int check_empty);
static zend_object *dom_objects_store_clone_obj(zend_object *zobject);
static void dom_nnodemap_object_dtor(zend_object *object);
-#if defined(LIBXML_XPATH_ENABLED)
+#ifdef LIBXML_XPATH_ENABLED
void dom_xpath_objects_free_storage(zend_object *object);
#endif
@@ -780,7 +780,7 @@ PHP_MINIT_FUNCTION(dom)
zend_hash_merge(&dom_processinginstruction_prop_handlers, &dom_node_prop_handlers, dom_copy_prop_handler, 0);
zend_hash_add_ptr(&classes, ce.name, &dom_processinginstruction_prop_handlers);
-#if defined(LIBXML_XPATH_ENABLED)
+#ifdef LIBXML_XPATH_ENABLED
memcpy(&dom_xpath_object_handlers, &dom_object_handlers, sizeof(zend_object_handlers));
dom_xpath_object_handlers.offset = XtOffsetOf(dom_xpath_object, dom) + XtOffsetOf(dom_object, std);
dom_xpath_object_handlers.free_obj = dom_xpath_objects_free_storage;
@@ -859,13 +859,13 @@ PHP_MINFO_FUNCTION(dom)
php_info_print_table_row(2, "DOM/XML", "enabled");
php_info_print_table_row(2, "DOM/XML API Version", DOM_API_VERSION);
php_info_print_table_row(2, "libxml Version", LIBXML_DOTTED_VERSION);
-#if defined(LIBXML_HTML_ENABLED)
+#ifdef LIBXML_HTML_ENABLED
php_info_print_table_row(2, "HTML Support", "enabled");
#endif
-#if defined(LIBXML_XPATH_ENABLED)
+#ifdef LIBXML_XPATH_ENABLED
php_info_print_table_row(2, "XPath Support", "enabled");
#endif
-#if defined(LIBXML_XPTR_ENABLED)
+#ifdef LIBXML_XPTR_ENABLED
php_info_print_table_row(2, "XPointer Support", "enabled");
#endif
#ifdef LIBXML_SCHEMAS_ENABLED
@@ -892,7 +892,7 @@ PHP_MSHUTDOWN_FUNCTION(dom) /* {{{ */
zend_hash_destroy(&dom_notation_prop_handlers);
zend_hash_destroy(&dom_entity_prop_handlers);
zend_hash_destroy(&dom_processinginstruction_prop_handlers);
-#if defined(LIBXML_XPATH_ENABLED)
+#ifdef LIBXML_XPATH_ENABLED
zend_hash_destroy(&dom_xpath_prop_handlers);
#endif
zend_hash_destroy(&classes);
@@ -941,7 +941,7 @@ void node_list_unlink(xmlNodePtr node)
}
/* }}} end node_list_unlink */
-#if defined(LIBXML_XPATH_ENABLED)
+#ifdef LIBXML_XPATH_ENABLED
/* {{{ dom_xpath_objects_free_storage */
void dom_xpath_objects_free_storage(zend_object *object)
{
@@ -1035,7 +1035,7 @@ zend_object *dom_objects_new(zend_class_entry *class_type)
}
/* }}} */
-#if defined(LIBXML_XPATH_ENABLED)
+#ifdef LIBXML_XPATH_ENABLED
/* {{{ zend_object dom_xpath_objects_new(zend_class_entry *class_type) */
zend_object *dom_xpath_objects_new(zend_class_entry *class_type)
{
diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h
index ec01196af7..7a0a5e7d72 100644
--- a/ext/dom/php_dom.h
+++ b/ext/dom/php_dom.h
@@ -34,15 +34,15 @@ extern zend_module_entry dom_module_entry;
#include <libxml/xinclude.h>
#include <libxml/hash.h>
#include <libxml/c14n.h>
-#if defined(LIBXML_HTML_ENABLED)
+#ifdef LIBXML_HTML_ENABLED
#include <libxml/HTMLparser.h>
#include <libxml/HTMLtree.h>
#endif
-#if defined(LIBXML_XPATH_ENABLED)
+#ifdef LIBXML_XPATH_ENABLED
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#endif
-#if defined(LIBXML_XPTR_ENABLED)
+#ifdef LIBXML_XPTR_ENABLED
#include <libxml/xpointer.h>
#endif
#ifdef PHP_WIN32
@@ -99,7 +99,7 @@ dom_object *dom_object_get_data(xmlNodePtr obj);
dom_doc_propsptr dom_get_doc_props(php_libxml_ref_obj *document);
zend_object *dom_objects_new(zend_class_entry *class_type);
zend_object *dom_nnodemap_objects_new(zend_class_entry *class_type);
-#if defined(LIBXML_XPATH_ENABLED)
+#ifdef LIBXML_XPATH_ENABLED
zend_object *dom_xpath_objects_new(zend_class_entry *class_type);
#endif
int dom_get_strict_error(php_libxml_ref_obj *document);
diff --git a/ext/dom/php_dom.stub.php b/ext/dom/php_dom.stub.php
index 3d77b136c7..a254df125c 100644
--- a/ext/dom/php_dom.stub.php
+++ b/ext/dom/php_dom.stub.php
@@ -306,7 +306,7 @@ class DOMDocument implements DOMParentNode
/** @return int|false */
public function save(string $filename, int $options = 0) {}
-#if defined(LIBXML_HTML_ENABLED)
+#ifdef LIBXML_HTML_ENABLED
/** @return DOMDocument|bool */
public function loadHTML(string $source, int $options = 0) {}
@@ -323,7 +323,7 @@ class DOMDocument implements DOMParentNode
/** @return string|false */
public function saveXML(?DOMNode $node = null, int $options = 0) {}
-#if defined(LIBXML_SCHEMAS_ENABLED)
+#ifdef LIBXML_SCHEMAS_ENABLED
/** @return bool */
public function schemaValidate(string $filename, int $flags = 0) {}
@@ -407,7 +407,7 @@ class DOMProcessingInstruction
public function __construct(string $name, string $value = "") {}
}
-#if defined(LIBXML_XPATH_ENABLED)
+#ifdef LIBXML_XPATH_ENABLED
class DOMXPath
{
public function __construct(DOMDocument $doc, bool $registerNodeNS = true) {}
diff --git a/ext/dom/processinginstruction.c b/ext/dom/processinginstruction.c
index c9718e24bb..7d4a080953 100644
--- a/ext/dom/processinginstruction.c
+++ b/ext/dom/processinginstruction.c
@@ -20,7 +20,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*
diff --git a/ext/dom/text.c b/ext/dom/text.c
index 0258598f06..63651985ca 100644
--- a/ext/dom/text.c
+++ b/ext/dom/text.c
@@ -20,7 +20,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
#include "dom_ce.h"
diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c
index fbb8f39afb..f453ca72f2 100644
--- a/ext/dom/xpath.c
+++ b/ext/dom/xpath.c
@@ -20,7 +20,7 @@
#endif
#include "php.h"
-#if HAVE_LIBXML && HAVE_DOM
+#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
#define PHP_DOM_XPATH_QUERY 0
@@ -30,7 +30,7 @@
* class DOMXPath
*/
-#if defined(LIBXML_XPATH_ENABLED)
+#ifdef LIBXML_XPATH_ENABLED
static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int type) /* {{{ */
{