Use HAVE_CONFIG_H to include <stdlib.h> and <string.h> in getopt sources.

This commit is contained in:
tsutsui 2024-05-31 20:41:50 +00:00
parent b3743583f0
commit d8b35192d7
3 changed files with 5 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.2 2024/05/31 20:27:19 tsutsui Exp $
# $NetBSD: Makefile,v 1.3 2024/05/31 20:41:50 tsutsui Exp $
# $OpenBSD: Makefile,v 1.8 2022/07/11 03:11:49 daniel Exp $
# NOTE: The mkhybrid distrib also makes an "mkisofs" which is the same binary
@ -25,6 +25,7 @@ SRCS+= block.c btree.c data.c file.c hfs.c low.c lvolume.c node.c record.c
SRCS+= apprentice.c lfile.c softmagic.c
CPPFLAGS+=-DSYSTEM_ID_DEFAULT=\"NetBSD\" -DAPPLE_HYB -DVANILLA_AUTOCONF \
-DHAVE_CONFIG_H \
-I${DIST} -I${DIST}/include \
-I${DIST}/libhfs_iso \
-I${DIST}/libfile

View File

@ -70,7 +70,7 @@ the executable file might be covered by the GNU General Public License. */
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#if defined(__GNU_LIBRARY__) || defined(__OpenBSD__)
#if defined(HAVE_STDLIB_H)
/* Don't include stdlib.h for non-GNU C libraries because some of them
contain conflicting prototypes for getopt. */
#include <stdlib.h>
@ -169,7 +169,7 @@ static enum
REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
} ordering;
#if defined(__GNU_LIBRARY__) || defined(__OpenBSD__)
#if defined(HAVE_STRING_H)
/* We want to avoid inclusion of string.h with non-GNU libraries
because there are many ways it can cause trouble.
On some systems, it contains special magic macros that don't work

View File

@ -55,7 +55,7 @@
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#ifdef __GNU_LIBRARY__
#if defined(HAVE_STDLIB_H)
#include <stdlib.h>
#else
char *getenv ();