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 26, 2023
1 parent 57f8966 commit 38f6e88
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ indent_size = 4

[Makefile]
indent_style = tab
indent_size = 4
indent_size = 8

[*.html]
indent_style = tab
Expand Down
7 changes: 7 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ <h2><a name="download"></a>Download</h2>
<h2><a name="history"></a>History</h2>

<dl class="history">
<dt><strong>Version 1.5.x</strong> [unreleased]</dt>
<dd>
<ul>
<li>Fix: allow workaround for <code>expat_config.h</code> not found.</li>
</ul>
</dd>

<dt><strong>Version 1.5.1</strong> [03/Oct/2022]</dt>
<dd>
<ul>
Expand Down
10 changes: 10 additions & 0 deletions src/lxplib.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,17 @@
#include <stdlib.h>
#include <string.h>

#ifndef LUAEXPAT_SKIP_EXPAT_CONFIG
// By default use the standard libexpat header. Some package managers
// do not include this header. In that case setting LUAEXPAT_SKIP_EXPAT_CONFIG
// allows you to override the option.
// 1. ensure you have libExpat 2.4+
// 2. try building the library
// 3. try building while defining LUAEXPAT_SKIP_DTD_SUPPORT and XML_DTD (include DTD support)
// 4. try building while defining LUAEXPAT_SKIP_DTD_SUPPORT (disable DTD support)
#include "expat_config.h"
#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 38f6e88

Please sign in to comment.