From: Magnus Jacobsson Date: Sat, 25 Dec 2021 14:50:26 +0000 (+0100) Subject: common: include utils.h and types.h in timing.c also for _WIN32 X-Git-Tag: 3.0.0~110^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1cf4bc4f90a55298a93d7be76bbaacebc5db9ce4;p=graphviz common: include utils.h and types.h in timing.c also for _WIN32 This ensures that the timing functions are declared with the storage-class attributes from utils.h. An upcoming commit that corrects the storage-class attribute declarations in utils.h would otherwise cause these errors: /usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: ../../lib/dotgen/.libs/libdotgen_C.a(mincross.o): in function `init_mincross': /home/magja/graphviz/lib/dotgen/mincross.c:1163: undefined reference to `__imp_start_timer' /usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: ../../lib/dotgen/.libs/libdotgen_C.a(mincross.o): in function `cleanup2': /home/magja/graphviz/lib/dotgen/mincross.c:996: undefined reference to `__imp_elapsed_sec' The reason for also including types.h is that utils.h depends on it without including it itself for unclear reasons. Note that these functions are also redundantly declared in timing.h. This file will be removed in an upcoming commit series. Towards https://gitlab.com/graphviz/graphviz/-/issues/2058. --- diff --git a/lib/common/timing.c b/lib/common/timing.c index 835324f72..9bc9ba0df 100644 --- a/lib/common/timing.c +++ b/lib/common/timing.c @@ -27,8 +27,6 @@ typedef struct tms mytime_t; #else #include -#include -#include typedef clock_t mytime_t; #define GET_TIME(S) S = clock() @@ -36,6 +34,8 @@ typedef clock_t mytime_t; #endif +#include +#include static mytime_t T;