From: Simon Marchi Date: Fri, 15 Mar 2024 15:36:49 +0000 (-0400) Subject: tap: import some changes X-Git-Url: http://git.efficios.com/?p=argpar.git;a=commitdiff_plain;h=HEAD;ds=sidebyside tap: import some changes Import some changes from: http://git.efficios.com/?p=babeltrace.git;a=tree;f=tests/utils/tap;h=fa181570e8d9b79801d8a8358aca00633856994e;hb=a165a5742a2b173e59900e515caa3b37a0afb42f Most importantly, the `extern "C"` allowing the use of this file in C++. Change-Id: I796dd0e07fe89ba84db97b8735705bae7e39d43c Signed-off-by: Simon Marchi --- diff --git a/tests/tap/tap.c b/tests/tap/tap.c index 9f41408..5fa9482 100644 --- a/tests/tap/tap.c +++ b/tests/tap/tap.c @@ -44,12 +44,12 @@ static void _cleanup(void); #ifdef __MINGW32__ static inline -void flockfile (FILE * filehandle) { +void flockfile (FILE * filehandle __attribute__((unused))) { return; } static inline -void funlockfile(FILE * filehandle) { +void funlockfile(FILE * filehandle __attribute__((unused))) { return; } #endif diff --git a/tests/tap/tap.h b/tests/tap/tap.h index b3e9445..f07c1db 100644 --- a/tests/tap/tap.h +++ b/tests/tap/tap.h @@ -5,8 +5,12 @@ * Copyright (C) 2017 Jérémie Galarneau */ +#ifdef __cplusplus +extern "C" { +#endif + /* '## __VA_ARGS__' is a gcc'ism. C99 doesn't allow the token pasting - and requires the caller to add the final comma if they've ommitted + and requires the caller to add the final comma if they've omitted the optional arguments */ #ifdef __GNUC__ # define ok(e, test, ...) ((e) ? \ @@ -80,3 +84,7 @@ void todo_start(const char *, ...); void todo_end(void); int exit_status(void); + +#ifdef __cplusplus +} +#endif