Fix [-Wundef] warning in DOM extension

This commit is contained in:
George Peter Banyard 2020-05-12 22:54:43 +02:00
parent 93b51f4e26
commit 62b1d2cb69
26 changed files with 47 additions and 47 deletions

View file

@ -21,7 +21,7 @@
#include "php.h"
#if HAVE_LIBXML && HAVE_DOM
#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"

View file

@ -20,7 +20,7 @@
#endif
#include "php.h"
#if HAVE_LIBXML && HAVE_DOM
#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*

View file

@ -20,7 +20,7 @@
#endif
#include "php.h"
#if HAVE_LIBXML && HAVE_DOM
#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*

View file

@ -20,7 +20,7 @@
#endif
#include "php.h"
#if HAVE_LIBXML && HAVE_DOM
#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*

View file

@ -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) /* {{{ */
{

View file

@ -20,7 +20,7 @@
#endif
#include "php.h"
#if HAVE_LIBXML && HAVE_DOM
#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*

View file

@ -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

View file

@ -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;

View file

@ -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"

View file

@ -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);

View file

@ -20,7 +20,7 @@
#endif
#include "php.h"
#if HAVE_LIBXML && HAVE_DOM
#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*

View file

@ -20,7 +20,7 @@
#endif
#include "php.h"
#if HAVE_LIBXML && HAVE_DOM
#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*

View file

@ -20,7 +20,7 @@
#endif
#include "php.h"
#if HAVE_LIBXML && HAVE_DOM
#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*

View file

@ -20,7 +20,7 @@
#endif
#include "php.h"
#if HAVE_LIBXML && HAVE_DOM
#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"

View file

@ -20,7 +20,7 @@
#endif
#include "php.h"
#if HAVE_LIBXML && HAVE_DOM
#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*

View file

@ -20,7 +20,7 @@
#endif
#include "php.h"
#if HAVE_LIBXML && HAVE_DOM
#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*

View file

@ -20,7 +20,7 @@
#endif
#include "php.h"
#if HAVE_LIBXML && HAVE_DOM
#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*

View file

@ -20,7 +20,7 @@
#endif
#include "php.h"
#if HAVE_LIBXML && HAVE_DOM
#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*

View file

@ -20,7 +20,7 @@
#endif
#include "php.h"
#if HAVE_LIBXML && HAVE_DOM
#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*

View file

@ -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

View file

@ -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)
{

View file

@ -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);

View file

@ -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) {}

View file

@ -20,7 +20,7 @@
#endif
#include "php.h"
#if HAVE_LIBXML && HAVE_DOM
#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
#include "php_dom.h"
/*

View file

@ -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"

View file

@ -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) /* {{{ */
{