]> granicus.if.org Git - graphviz/commitdiff
common: include utils.h and types.h in timing.c also for _WIN32
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sat, 25 Dec 2021 14:50:26 +0000 (15:50 +0100)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sat, 25 Dec 2021 21:04:56 +0000 (22:04 +0100)
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.

lib/common/timing.c

index 835324f7271b0a9e3f162326874780b76c5bc161..9bc9ba0df692808184f39d0b6833d5f75c26bf1e 100644 (file)
@@ -27,8 +27,6 @@ typedef struct tms mytime_t;
 #else
 
 #include       <time.h>
-#include <common/types.h>
-#include    <common/utils.h>
 
 typedef clock_t mytime_t;
 #define GET_TIME(S) S = clock()
@@ -36,6 +34,8 @@ typedef clock_t mytime_t;
 
 #endif
 
+#include <common/types.h>
+#include <common/utils.h>
 
 static mytime_t T;