From 4a2eb0b7f08c9cb2dbed850462900c7d7a58ec83 Mon Sep 17 00:00:00 2001 From: Mohammed Khajapasha Date: Wed, 19 Jun 2019 09:30:47 +0000 Subject: [PATCH] Enable XML_ATTR_INFO in build enable XML_ATTR_INFO in build to cover XML_ATTR_INFO in CI Signed-off-by: Mohammed Khajapasha --- expat/CMakeLists.txt | 6 ++++++ expat/configure.ac | 9 +++++++++ expat/coverage.sh | 10 ++++++++-- expat/expat_config.h.cmake | 3 +++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt index e8777e23..69bd4bde 100644 --- a/expat/CMakeLists.txt +++ b/expat/CMakeLists.txt @@ -60,6 +60,7 @@ if(NOT WIN32) endif() option(XML_UNICODE "Use UTF-16 encoded chars (two bytes) instead of UTF-8" OFF) option(XML_UNICODE_WCHAR_T "Use wchar_t to represent UTF-16 instead of unsigned short" OFF) +option(XML_ATTR_INFO "Define to allow retrieving the byte offsets for attribute names and values" OFF) if(XML_DTD) set(XML_DTD 1) @@ -81,6 +82,11 @@ if(XML_UNICODE_WCHAR_T) else(XML_UNICODE_WCHAR_T) set(XML_UNICODE_WCHAR_T 0) endif(XML_UNICODE_WCHAR_T) +if(XML_ATTR_INFO) + set(XML_ATTR_INFO 1) +else(XML_ATTR_INFO) + set(XML_ATTR_INFO 0) +endif(XML_ATTR_INFO) if(XML_UNICODE_WCHAR_T AND NOT XML_UNICODE) message(SEND_ERROR "Option XML_UNICODE_WCHAR_T=ON may not be used without XML_UNICODE=ON.") diff --git a/expat/configure.ac b/expat/configure.ac index 95bdaea1..c9faa191 100644 --- a/expat/configure.ac +++ b/expat/configure.ac @@ -222,6 +222,15 @@ AC_DEFINE([XML_DTD], 1, AC_DEFINE([XML_DEV_URANDOM], 1, [Define to include code reading entropy from `/dev/urandom'.]) +AC_ARG_ENABLE([xml-attr-info], + [AS_HELP_STRING([--enable-xml-attr-info], + [Enable retrieving the byte offsets for attribute names and values + (default is disabled)])], , + [enable_xml_attr_info=no]) +AS_IF([test "x${enable_xml_attr_info}" = "xyes"], + [AC_DEFINE([XML_ATTR_INFO], 1, + [Define to allow retrieving the byte offsets for attribute names and values.])]) + AC_ARG_ENABLE([xml-context], AS_HELP_STRING([--enable-xml-context @<:@COUNT@:>@], [Retain context around the current parse point; diff --git a/expat/coverage.sh b/expat/coverage.sh index 1121fc79..67406fcd 100755 --- a/expat/coverage.sh +++ b/expat/coverage.sh @@ -41,6 +41,10 @@ _configure() { ${unicode_enabled} \ && configure_args+=( CPPFLAGS='-DXML_UNICODE -DXML_UNICODE_WCHAR_T' ) + if [[ "${xml_attr_info}" = true ]]; then + configure_args+=( --enable-xml-attr-info ) + fi + if [[ ${xml_context} -eq 0 ]]; then configure_args+=( --disable-xml-context ) else @@ -211,8 +215,10 @@ _main() { continue fi - for xml_context in 0 1024 ; do - _build_case + for xml_attr_info in true false ; do + for xml_context in 0 1024 ; do + _build_case + done done done done diff --git a/expat/expat_config.h.cmake b/expat/expat_config.h.cmake index f1f51440..d63ece82 100644 --- a/expat/expat_config.h.cmake +++ b/expat/expat_config.h.cmake @@ -99,6 +99,9 @@ /* Define to use wchar_t as UTF-16 char type instead of unsigned short. */ #cmakedefine XML_UNICODE_WCHAR_T +/* Define to allow retrieving the byte offsets for attribute names and values. */ +#cmakedefine XML_ATTR_INFO + /* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */ #ifdef _MSC_VER # define __func__ __FUNCTION__