make(1): replace GNode macros with inline functions
Curiously, this affects the size of the generated code: it gets smaller than before.
This commit is contained in:
parent
41b60e14d8
commit
da5a66a335
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: make.h,v 1.152 2020/10/03 21:19:54 rillig Exp $ */
|
||||
/* $NetBSD: make.h,v 1.153 2020/10/05 15:14:24 rillig Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1989, 1990, 1993
|
||||
@ -259,7 +259,9 @@ typedef enum {
|
||||
/* Already processed by Suff_FindDeps */
|
||||
OP_DEPS_FOUND = 1 << 25,
|
||||
/* Node found while expanding .ALLSRC */
|
||||
OP_MARK = 1 << 24
|
||||
OP_MARK = 1 << 24,
|
||||
|
||||
OP_NOTARGET = OP_NOTMAIN | OP_USE | OP_EXEC | OP_TRANSFORM
|
||||
} GNodeType;
|
||||
|
||||
typedef enum {
|
||||
@ -358,15 +360,6 @@ typedef struct GNode {
|
||||
int lineno;
|
||||
} GNode;
|
||||
|
||||
#define NoExecute(gn) ((gn->type & OP_MAKE) ? noRecursiveExecute : noExecute)
|
||||
/*
|
||||
* OP_NOP will return TRUE if the node with the given type was not the
|
||||
* object of a dependency operator
|
||||
*/
|
||||
#define OP_NOP(t) (((t) & OP_OPMASK) == 0x00000000)
|
||||
|
||||
#define OP_NOTARGET (OP_NOTMAIN|OP_USE|OP_EXEC|OP_TRANSFORM)
|
||||
|
||||
/*
|
||||
* Error levels for parsing. PARSE_FATAL means the process cannot continue
|
||||
* once the makefile has been parsed. PARSE_WARNING means it can. Passed
|
||||
@ -568,6 +561,22 @@ int mkTempFile(const char *, char **);
|
||||
int str2Lst_Append(StringList *, char *, const char *);
|
||||
void GNode_FprintDetails(FILE *, const char *, const GNode *, const char *);
|
||||
|
||||
static Boolean MAKE_ATTR_UNUSED
|
||||
NoExecute(GNode *gn)
|
||||
{
|
||||
return (gn->type & OP_MAKE) ? noRecursiveExecute : noExecute;
|
||||
}
|
||||
|
||||
/*
|
||||
* See if the node with the given type was not the object of a dependency
|
||||
* operator.
|
||||
*/
|
||||
static Boolean MAKE_ATTR_UNUSED
|
||||
OP_NOP(GNodeType t)
|
||||
{
|
||||
return !(t & OP_OPMASK);
|
||||
}
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define UNCONST(ptr) ({ \
|
||||
union __unconst { \
|
||||
|
Loading…
Reference in New Issue
Block a user