]> granicus.if.org Git - graphviz/commitdiff
Remove `_may_use_threads` from lib/sfio/vthread.h
authorErwin Janssen <erwinjanssen@outlook.com>
Mon, 31 Oct 2016 14:59:41 +0000 (15:59 +0100)
committerErwin Janssen <erwinjanssen@outlook.com>
Wed, 7 Dec 2016 13:52:38 +0000 (14:52 +0100)
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.

lib/sfio/vthread.h

index b06d96232e1bdf9d4a20397dfc51bcf37f2f3287..1d105ff0359651d4206d2a87a4a7256b221e5391 100644 (file)
@@ -30,38 +30,7 @@ extern "C" {
 #include       <ast_common.h>
 #include       <errno.h>
 
-#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                       <pthread.h>
-    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                       <windows.h>
-    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