From: Erwin Janssen Date: Mon, 31 Oct 2016 14:59:41 +0000 (+0100) Subject: Remove `_may_use_threads` from lib/sfio/vthread.h X-Git-Tag: 2.42.0~229^2~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=740d1e59f99547bffd26677b50920e228b2980a3;p=graphviz Remove `_may_use_threads` from lib/sfio/vthread.h The define `_may_use_threads` is set after checking some condition, but is `undef`ed immediately after. The checks that follow only succeed if `_may_use_threads` is defined, so they all fail and nothing happens. Therefore, the checks of this define and the usage of it can be removed. --- diff --git a/lib/sfio/vthread.h b/lib/sfio/vthread.h index b06d96232..1d105ff03 100644 --- a/lib/sfio/vthread.h +++ b/lib/sfio/vthread.h @@ -30,38 +30,7 @@ extern "C" { #include #include -#if !defined(vt_threaded) || (defined(vt_threaded) && vt_threaded == 1) -#define _may_use_threads 1 -#else -#define _may_use_threads 0 -#endif #undef vt_threaded -#undef _may_use_threads - -#if defined(_may_use_threads) && !defined(vt_threaded) && defined(_hdr_pthread) -#define vt_threaded 1 -#include - typedef pthread_mutex_t _vtmtx_t; - typedef pthread_once_t _vtonce_t; - typedef pthread_t _vtself_t; - typedef pthread_t _vtid_t; - typedef pthread_attr_t _vtattr_t; - -#if !defined(PTHREAD_ONCE_INIT) && defined(pthread_once_init) -#define PTHREAD_ONCE_INIT pthread_once_init -#endif - -#endif - -#if defined(_may_use_threads) && !defined(vt_threaded) && defined(_WIN32) -#define vt_threaded 1 -#include - typedef CRITICAL_SECTION _vtmtx_t; - typedef int _vtonce_t; - typedef HANDLE _vtself_t; - typedef DWORD _vtid_t; - typedef SECURITY_ATTRIBUTES _vtattr_t; -#endif #ifndef vt_threaded #define vt_threaded 0