summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--configure.ac1
-rw-r--r--lib/sqfs/write_inode.c3
3 files changed, 4 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ecdb80e..121f3bb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
on Fedora.
- Make `rdsquashfs` describe mode terminate with an error message if an illegal
filename is encountered (#52).
+- Don't include alloca.h on systems that don't provide that header.
## [0.9.1] - 2020-05-03
### Added
diff --git a/configure.ac b/configure.ac
index 16629d5..54d43f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -240,6 +240,7 @@ AX_COMPILE_CHECK_SIZEOF(long long)
AC_CHECK_HEADERS([sys/xattr.h], [], [])
AC_CHECK_HEADERS([sys/sysinfo.h], [], [])
+AC_CHECK_HEADERS([alloca.h], [], [])
AC_CHECK_FUNCS([strndup getline getsubopt])
diff --git a/lib/sqfs/write_inode.c b/lib/sqfs/write_inode.c
index 787c4b5..8d8fa7a 100644
--- a/lib/sqfs/write_inode.c
+++ b/lib/sqfs/write_inode.c
@@ -14,13 +14,14 @@
#include "compat.h"
#include <string.h>
+#include <stdlib.h>
#if defined(_WIN32) || defined(__WINDOWS__)
# include <malloc.h>
# ifdef _MSC_VER
# define alloca _alloca
# endif
-#else
+#elif defined(HAVE_ALLOCA_H)
# include <alloca.h>
#endif