Module Name: src Committed By: rillig Date: Sat Feb 5 00:26:21 UTC 2022
Modified Files: src/usr.bin/make: make.h trace.c Log Message: make: improve C90 support Do not use inline functions, remove trailing comma in enum declaration, do not use 'long long' for printing a timestamp. This re-introduces the Year 2038 Problem for pre-C99 compilers when printing the trace log, but that is a seldom used feature. To generate a diff of this commit: cvs rdiff -u -r1.297 -r1.298 src/usr.bin/make/make.h cvs rdiff -u -r1.30 -r1.31 src/usr.bin/make/trace.c 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/make.h diff -u src/usr.bin/make/make.h:1.297 src/usr.bin/make/make.h:1.298 --- src/usr.bin/make/make.h:1.297 Fri Feb 4 23:22:19 2022 +++ src/usr.bin/make/make.h Sat Feb 5 00:26:21 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.297 2022/02/04 23:22:19 rillig Exp $ */ +/* $NetBSD: make.h,v 1.298 2022/02/05 00:26:21 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -136,7 +136,11 @@ #define MAKE_ATTR_USE /* delete */ #endif +#if __STDC__ >= 199901L || defined(lint) #define MAKE_INLINE static inline MAKE_ATTR_UNUSED +#else +#define MAKE_INLINE static MAKE_ATTR_UNUSED +#endif /* MAKE_STATIC marks a function that may or may not be inlined. */ #if defined(lint) @@ -359,7 +363,7 @@ typedef enum GNodeType { */ OP_DEPS_FOUND = 1 << 24, /* Node found while expanding .ALLSRC */ - OP_MARK = 1 << 23, + OP_MARK = 1 << 23 } GNodeType; typedef struct GNodeFlags { Index: src/usr.bin/make/trace.c diff -u src/usr.bin/make/trace.c:1.30 src/usr.bin/make/trace.c:1.31 --- src/usr.bin/make/trace.c:1.30 Wed Dec 15 12:58:01 2021 +++ src/usr.bin/make/trace.c Sat Feb 5 00:26:21 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: trace.c,v 1.30 2021/12/15 12:58:01 rillig Exp $ */ +/* $NetBSD: trace.c,v 1.31 2022/02/05 00:26:21 rillig Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -48,7 +48,7 @@ #include "job.h" #include "trace.h" -MAKE_RCSID("$NetBSD: trace.c,v 1.30 2021/12/15 12:58:01 rillig Exp $"); +MAKE_RCSID("$NetBSD: trace.c,v 1.31 2022/02/05 00:26:21 rillig Exp $"); static FILE *trfile; static pid_t trpid; @@ -90,10 +90,17 @@ Trace_Log(TrEvent event, Job *job) gettimeofday(&rightnow, NULL); +#if __STDC__ >= 199901L fprintf(trfile, "%lld.%06ld %d %s %d %s", (long long)rightnow.tv_sec, (long)rightnow.tv_usec, jobTokensRunning, evname[event], trpid, trwd); +#else + fprintf(trfile, "%ld.%06ld %d %s %d %s", + (long)rightnow.tv_sec, (long)rightnow.tv_usec, + jobTokensRunning, + evname[event], trpid, trwd); +#endif if (job != NULL) { char flags[4];