Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build) add define to build without expat_config.h #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading