From: Matthew Fernandez Date: Sat, 9 Apr 2022 19:31:35 +0000 (-0700) Subject: sparse: unconditionally include 'graphviz_exit' from cgraph X-Git-Tag: 4.0.0~55^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac43f9f6594b0f9bf2b85cad3f8727ce99e63c0b;p=graphviz 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. --- 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