aboutsummaryrefslogtreecommitdiff
path: root/lib/getopt.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2023-09-12 20:55:10 +0300
committerLasse Collin <lasse.collin@tukaani.org>2023-09-22 20:06:27 +0300
commitaff1b479c7b168652bd20305ceed4317d5db6661 (patch)
tree2a755daa9212001d9d432212eb6683400d3d124d /lib/getopt.c
parentDoxygen: Add more C macro names to PREDEFINED. (diff)
downloadxz-aff1b479c7b168652bd20305ceed4317d5db6661.tar.xz
lib/getopt*.c: Include <config.h> only HAVE_CONFIG_H is defined.
The CMake-based build doesn't use config.h. Up-to-date getopt_long in Gnulib is LGPLv2 so at some point it could be included in XZ Utils too but for now this commit is enough to make CMake-based build possible.
Diffstat (limited to '')
-rw-r--r--lib/getopt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/getopt.c b/lib/getopt.c
index f8fc003d..36c28318 100644
--- a/lib/getopt.c
+++ b/lib/getopt.c
@@ -21,7 +21,9 @@
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _LIBC
-# include <config.h>
+# ifdef HAVE_CONFIG_H
+# include <config.h>
+# endif
#endif
#include "getopt.h"