Module Name: src Committed By: rillig Date: Thu Aug 13 03:54:57 UTC 2020
Modified Files: src/usr.bin/make: hash.h job.h lst.h make.h metachar.h strlist.h Log Message: make(1): follow naming conventions for multiple-inclusion guards This avoids undefined behavior. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/usr.bin/make/hash.h cvs rdiff -u -r1.43 -r1.44 src/usr.bin/make/job.h cvs rdiff -u -r1.20 -r1.21 src/usr.bin/make/lst.h cvs rdiff -u -r1.115 -r1.116 src/usr.bin/make/make.h cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/metachar.h cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/strlist.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/make/hash.h diff -u src/usr.bin/make/hash.h:1.17 src/usr.bin/make/hash.h:1.18 --- src/usr.bin/make/hash.h:1.17 Thu Aug 6 17:22:15 2020 +++ src/usr.bin/make/hash.h Thu Aug 13 03:54:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: hash.h,v 1.17 2020/08/06 17:22:15 rillig Exp $ */ +/* $NetBSD: hash.h,v 1.18 2020/08/13 03:54:57 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -78,8 +78,8 @@ * which maintains hash tables. */ -#ifndef _HASH_H -#define _HASH_H +#ifndef MAKE_HASH_H +#define MAKE_HASH_H /* * The following defines one entry in the hash table. @@ -143,4 +143,4 @@ Hash_Entry *Hash_EnumNext(Hash_Search *) void Hash_ForEach(Hash_Table *, void (*)(void *, void *), void *); void Hash_DebugStats(Hash_Table *, const char *); -#endif /* _HASH_H */ +#endif /* MAKE_HASH_H */ Index: src/usr.bin/make/job.h diff -u src/usr.bin/make/job.h:1.43 src/usr.bin/make/job.h:1.44 --- src/usr.bin/make/job.h:1.43 Fri Jul 3 08:13:23 2020 +++ src/usr.bin/make/job.h Thu Aug 13 03:54:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: job.h,v 1.43 2020/07/03 08:13:23 rillig Exp $ */ +/* $NetBSD: job.h,v 1.44 2020/08/13 03:54:57 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -77,8 +77,8 @@ * job.h -- * Definitions pertaining to the running of jobs in parallel mode. */ -#ifndef _JOB_H_ -#define _JOB_H_ +#ifndef MAKE_JOB_H +#define MAKE_JOB_H #define TMPPAT "makeXXXXXX" /* relative to tmpdir */ @@ -271,4 +271,4 @@ void Job_ServerStart(int, int, int); void Job_SetPrefix(void); Boolean Job_RunTarget(const char *, const char *); -#endif /* _JOB_H_ */ +#endif /* MAKE_JOB_H */ Index: src/usr.bin/make/lst.h diff -u src/usr.bin/make/lst.h:1.20 src/usr.bin/make/lst.h:1.21 --- src/usr.bin/make/lst.h:1.20 Sun Sep 7 20:55:34 2014 +++ src/usr.bin/make/lst.h Thu Aug 13 03:54:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: lst.h,v 1.20 2014/09/07 20:55:34 joerg Exp $ */ +/* $NetBSD: lst.h,v 1.21 2020/08/13 03:54:57 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -77,8 +77,8 @@ * lst.h -- * Header for using the list library */ -#ifndef _LST_H_ -#define _LST_H_ +#ifndef MAKE_LST_H +#define MAKE_LST_H #include <sys/param.h> #include <stdlib.h> @@ -186,4 +186,4 @@ ReturnStatus Lst_EnQueue(Lst, void *); /* Remove an element from head of queue */ void *Lst_DeQueue(Lst); -#endif /* _LST_H_ */ +#endif /* MAKE_LST_H */ Index: src/usr.bin/make/make.h diff -u src/usr.bin/make/make.h:1.115 src/usr.bin/make/make.h:1.116 --- src/usr.bin/make/make.h:1.115 Tue Aug 11 18:44:52 2020 +++ src/usr.bin/make/make.h Thu Aug 13 03:54:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.115 2020/08/11 18:44:52 rillig Exp $ */ +/* $NetBSD: make.h,v 1.116 2020/08/13 03:54:57 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -77,8 +77,8 @@ * The global definitions for pmake */ -#ifndef _MAKE_H_ -#define _MAKE_H_ +#ifndef MAKE_MAKE_H +#define MAKE_MAKE_H #include <sys/types.h> #include <sys/param.h> @@ -524,4 +524,4 @@ int cached_stat(const char *, void *); #define KILLPG(pid, sig) killpg((pid), (sig)) #endif -#endif /* _MAKE_H_ */ +#endif /* MAKE_MAKE_H */ Index: src/usr.bin/make/metachar.h diff -u src/usr.bin/make/metachar.h:1.4 src/usr.bin/make/metachar.h:1.5 --- src/usr.bin/make/metachar.h:1.4 Sun Jun 21 20:26:02 2015 +++ src/usr.bin/make/metachar.h Thu Aug 13 03:54:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: metachar.h,v 1.4 2015/06/21 20:26:02 christos Exp $ */ +/* $NetBSD: metachar.h,v 1.5 2020/08/13 03:54:57 rillig Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -28,8 +28,8 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _METACHAR_H -#define _METACHAR_H +#ifndef MAKE_METACHAR_H +#define MAKE_METACHAR_H #include <ctype.h> @@ -58,4 +58,4 @@ needshell(const char *cmd, int white) return *cmd != '\0'; } -#endif /* _METACHAR_H */ +#endif /* MAKE_METACHAR_H */ Index: src/usr.bin/make/strlist.h diff -u src/usr.bin/make/strlist.h:1.3 src/usr.bin/make/strlist.h:1.4 --- src/usr.bin/make/strlist.h:1.3 Fri Jan 16 21:15:34 2009 +++ src/usr.bin/make/strlist.h Thu Aug 13 03:54:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: strlist.h,v 1.3 2009/01/16 21:15:34 dsl Exp $ */ +/* $NetBSD: strlist.h,v 1.4 2020/08/13 03:54:57 rillig Exp $ */ /*- * Copyright (c) 2008 - 2009 The NetBSD Foundation, Inc. @@ -32,8 +32,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _STRLIST_H -#define _STRLIST_H +#ifndef MAKE_STRLIST_H +#define MAKE_STRLIST_H typedef struct { char *si_str; @@ -59,4 +59,4 @@ void strlist_add_str(strlist_t *, char * if ((sl)->sl_items != NULL) \ for (index = 0; (v = strlist_str(sl, index)) != NULL; index++) -#endif /* _STRLIST_H */ +#endif /* MAKE_STRLIST_H */