mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
Fix lpc2xml for old libxml version
This commit is contained in:
parent
56470e4ddd
commit
3016ec37d0
3 changed files with 9 additions and 5 deletions
|
|
@ -150,7 +150,7 @@ AC_ARG_ENABLE(tools,
|
|||
|
||||
dnl check libxml2 (needed for tools)
|
||||
if test "$build_tools" != "false" ; then
|
||||
PKG_CHECK_MODULES(LIBXML2, [libxml-2.0 >= 2.9 ],[],
|
||||
PKG_CHECK_MODULES(LIBXML2, [libxml-2.0],[],
|
||||
[
|
||||
if test "$build_tools" = "true" ; then
|
||||
AC_MSG_ERROR([Could not found libxml2, tools cannot be compiled.])
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "lpc2xml.h"
|
||||
#include <string.h>
|
||||
#include <libxml/xmlsave.h>
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#define LPC2XML_BZ 2048
|
||||
|
||||
|
|
@ -216,7 +216,7 @@ int lpc2xml_convert_fd(lpc2xml_context* context, int fd) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
int lpc2xml_convert_string(lpc2xml_context* context, unsigned char **content) {
|
||||
int lpc2xml_convert_string(lpc2xml_context* context, char **content) {
|
||||
int ret = 0;
|
||||
xmlBufferPtr buffer = xmlBufferCreate();
|
||||
xmlSaveCtxtPtr save_ctx = xmlSaveToBuffer(buffer, "UTF-8", XML_SAVE_FORMAT);
|
||||
|
|
@ -226,7 +226,11 @@ int lpc2xml_convert_string(lpc2xml_context* context, unsigned char **content) {
|
|||
}
|
||||
xmlSaveClose(save_ctx);
|
||||
if(ret == 0) {
|
||||
*content = xmlBufferDetach(buffer);
|
||||
#if LIBXML_VERSION >= 20800
|
||||
*content = (char *)xmlBufferDetach(buffer);
|
||||
#else
|
||||
*content = strdup((const char *)xmlBufferContent(buffer));
|
||||
#endif
|
||||
}
|
||||
xmlBufferFree(buffer);
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ int lpc2xml_set_lpc(lpc2xml_context* context, const LpConfig *lpc);
|
|||
|
||||
int lpc2xml_convert_file(lpc2xml_context* context, const char *filename);
|
||||
int lpc2xml_convert_fd(lpc2xml_context* context, int fd);
|
||||
int lpc2xml_convert_string(lpc2xml_context* context, unsigned char **content);
|
||||
int lpc2xml_convert_string(lpc2xml_context* context, char **content);
|
||||
|
||||
|
||||
#endif //LPC2XML_H_
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue