Skip to content

Commit

Permalink
chore(build) add define to build without expat_config.h
Browse files Browse the repository at this point in the history
  • Loading branch information
Tieske committed Jan 4, 2023
1 parent 57f8966 commit dd6d3b9
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/lxplib.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,27 @@
#include <stdlib.h>
#include <string.h>

#include "expat_config.h"
#ifndef LUAEXPAT_SKIP_DTD_SUPPORT
// Not defined, so use the standard libexpat header. Some package managers
// do not include this header. In that case LUAEXPAT_SKIP_DTD_SUPPORT allows
// you to override the option.
// 1. ensure you have libExpat 2.4+
// 2. try building using LUAEXPAT_SKIP_DTD_SUPPORT=0
// 3. try building using LUAEXPAT_SKIP_DTD_SUPPORT=1
#include "expat_config.h"
#else
#if LUAEXPAT_SKIP_DTD_SUPPORT == 0
// Force the use of DTD support, if your libExpat was compiled without DTD
// support, it will cause trouble.
#define XML_DTD 1
#elif LUAEXPAT_SKIP_DTD_SUPPORT == 1
// Skip the use of DTD support.
#undef XML_DTD
#else
#error LUAEXPAT_SKIP_DTD_SUPPORT must be either 0 or 1, or remain unset
#endif
#endif

#include "expat.h"
#if (XML_MAJOR_VERSION == 2 && XML_MINOR_VERSION < 4) || (XML_MAJOR_VERSION < 2)
#error Expat 2.4 or newer is required
Expand Down

0 comments on commit dd6d3b9

Please sign in to comment.