From 3a8e462bd34227385d7c4c912fbd42d870310819 Mon Sep 17 00:00:00 2001 From: kannibalox Date: Sun, 27 Oct 2024 17:08:27 -0400 Subject: [PATCH] Throw error if attempting to use both xmlrpc-c and tinyxml2 --- configure.ac | 4 ++++ src/rpc/xmlrpc_c.cc | 4 ++++ src/rpc/xmlrpc_tinyxml2.cc | 7 ++++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 289a1bed..fe428c4d 100755 --- a/configure.ac +++ b/configure.ac @@ -58,6 +58,10 @@ AC_LANG_POP(C++) TORRENT_WITH_TINYXML2 +#if test ${with_xmlrpc_tinyxml2+y} && test ${with_xmlrpc_c+y}; then +# AC_MSG_ERROR([--with-xmlrpc-c and --with-xmlrpc-tinyxml2 cannot be used together. Please choose only one]) +#fi + AC_DEFINE(HAVE_CONFIG_H, 1, true if config.h was included) AC_DEFINE(USER_AGENT, [std::string(PACKAGE "/" VERSION "/") + torrent::version()], Http user agent) diff --git a/src/rpc/xmlrpc_c.cc b/src/rpc/xmlrpc_c.cc index a0642b2b..8592f8c9 100644 --- a/src/rpc/xmlrpc_c.cc +++ b/src/rpc/xmlrpc_c.cc @@ -37,6 +37,10 @@ #include "config.h" #ifdef HAVE_XMLRPC_C +#ifdef HAVE_XMLRPC_TINYXML2 +#error HAVE_XMLRPC_C and HAVE_XMLRPC_TINYXML2 cannot be used together. Please choose only one +#endif + #include #include diff --git a/src/rpc/xmlrpc_tinyxml2.cc b/src/rpc/xmlrpc_tinyxml2.cc index 0ec2c540..cdcea478 100644 --- a/src/rpc/xmlrpc_tinyxml2.cc +++ b/src/rpc/xmlrpc_tinyxml2.cc @@ -37,7 +37,9 @@ #include "config.h" #ifdef HAVE_XMLRPC_TINYXML2 -#ifndef HAVE_XMLRPC_C +#ifdef HAVE_XMLRPC_C +#error HAVE_XMLRPC_C and HAVE_XMLRPC_TINYXML2 cannot be used together. Please choose only one +#endif #include #include @@ -449,5 +451,4 @@ bool XmlRpc::is_valid() const { return m_isValid; } } -#endif // ifndef HAVE_XMLRPC_C -#endif // ifdef HAVE_XMLRPC_TINYXML2 +#endif