From 7ca3f68ac2aa6ee7cee632f8cd72cc3ef6c4faa9 Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Mon, 25 Sep 2023 02:38:54 +0200 Subject: fix impl include order bug --- source/kit/kit_test.h | 57 +++++++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 24 deletions(-) (limited to 'source') diff --git a/source/kit/kit_test.h b/source/kit/kit_test.h index 0f07b32..910bdf1 100644 --- a/source/kit/kit_test.h +++ b/source/kit/kit_test.h @@ -289,26 +289,37 @@ int kit_run_benchmarks(int argc, char **argv); # define run_benchmarks kit_run_benchmarks #endif -#ifdef KIT_TEST_IMPLEMENTATION +#ifdef __cplusplus +} +#endif -# ifndef KIT_TIME_H -# define KIT_TIME_H +#endif -# include +#if defined(KIT_TEST_IMPLEMENTATION) && !defined(KIT_TEST_H_IMPL) +#define KIT_TEST_H_IMPL -# ifndef TIME_UTC -# define TIME_UTC 1 -# endif +#ifdef __cplusplus +extern "C" { +#endif -# ifdef KIT_REQUIRE_TIMESPEC_GET -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN 1 -# endif -# include +#ifndef KIT_TIME_H +# define KIT_TIME_H -# define KIT_TIMESPEC_IMPL_UNIX_EPOCH_IN_TICKS \ - 116444736000000000ull -# define KIT_TIMESPEC_IMPL_TICKS_PER_SECONDS 10000000ull +# include + +# ifndef TIME_UTC +# define TIME_UTC 1 +# endif + +# ifdef KIT_REQUIRE_TIMESPEC_GET +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN 1 +# endif +# include + +# define KIT_TIMESPEC_IMPL_UNIX_EPOCH_IN_TICKS \ + 116444736000000000ull +# define KIT_TIMESPEC_IMPL_TICKS_PER_SECONDS 10000000ull static int timespec_get(struct timespec *ts, int base) { if (ts == NULL || base != TIME_UTC) @@ -328,15 +339,15 @@ static int timespec_get(struct timespec *ts, int base) { return base; } -# endif - # endif -# include -# include -# include -# include -# include +#endif + +#include +#include +#include +#include +#include enum { kit_white_, @@ -1095,8 +1106,6 @@ int kit_run_benchmarks(int argc, char **argv) { return status; } -#endif - #ifdef __cplusplus } #endif -- cgit v1.2.3