From ac43f9f6594b0f9bf2b85cad3f8727ce99e63c0b Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 9 Apr 2022 12:31:35 -0700 Subject: [PATCH] sparse: unconditionally include 'graphviz_exit' from cgraph This fixes a problem encountered in an upcoming commit, that other code cannot include both this header and cgraph/exit.h if it is building in standalone mode. cgraph/exit.h is header-only, so should be fine to use even in standalone mode. --- lib/sparse/general.h | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/lib/sparse/general.h b/lib/sparse/general.h index 37be67e80..b193bd707 100644 --- a/lib/sparse/general.h +++ b/lib/sparse/general.h @@ -15,13 +15,13 @@ #include #include #include +#include /* Applications that do not use the common library can define STANDALONE * to get definitions/definitions that are normally provided there. * In particular, note that Verbose is declared but undefined. */ #ifndef STANDALONE #include "cgraph.h" -#include "exit.h" #include "globals.h" #include "logic.h" #include "arith.h" @@ -66,26 +66,6 @@ __declspec(dllimport) extern unsigned char Verbose; extern unsigned char Verbose; #endif -#ifdef __GNUC__ -// FIXME: use _Noreturn for all compilers when we move to C11 -#define NORETURN __attribute__((noreturn)) -#elif defined(_MSC_VER) -#define NORETURN __declspec(noreturn) -#else -#define NORETURN /* nothing */ -#endif - -static inline NORETURN void graphviz_exit(int status) { -#ifdef __MINGW32__ - // workaround for https://gitlab.com/graphviz/graphviz/-/issues/2178 - fflush(stdout); - fflush(stderr); -#endif - exit(status); -} - -#undef NORETURN - #else /* STANDALONE */ #define CALLOC gcalloc #define MALLOC gmalloc -- 2.40.0