Use POSIX functions on Cygwin, not Win32 function
[openssl.git] / crypto / async / arch / async_win.h
index 6c2a31007d625dc1934336cbda6792726f9f2930..31f248216f1175668e728c11f9b912cda44194ea 100644 (file)
  * ====================================================================
  */
 
-#include <openssl/async.h>
-
 /*
  * This is the same detection used in cryptlib to set up the thread local
  * storage that we depend on, so just copy that
  */
-#if defined(_WIN32) || defined(__CYGWIN__)
+#if defined(_WIN32)
+#include <openssl/async.h>
 # define ASYNC_WIN
 # define ASYNC_ARCH
 
 # include <windows.h>
-# include "cryptlib.h"
+# include "internal/cryptlib.h"
 
 typedef struct async_fibre_st {
     LPVOID fibre;
-} ASYNC_FIBRE;
+    int converted;
+} async_fibre;
 
-# define ASYNC_set_ctx(nctx) \
-        (CRYPTO_set_thread_local(CRYPTO_THREAD_LOCAL_ASYNC_CTX, (void *)(nctx)))
-# define ASYNC_get_ctx() \
-        ((ASYNC_CTX *)CRYPTO_get_thread_local(CRYPTO_THREAD_LOCAL_ASYNC_CTX))
-# define ASYNC_FIBRE_swapcontext(o,n,r) \
+# define async_fibre_swapcontext(o,n,r) \
         (SwitchToFiber((n)->fibre), 1)
-# define ASYNC_FIBRE_makecontext(c) \
-        ((c)->fibre = CreateFiber(0, ASYNC_start_func_win, 0))
-# define ASYNC_FIBRE_free(f)             (DeleteFiber((f)->fibre))
+# define async_fibre_makecontext(c) \
+        ((c)->fibre = CreateFiber(0, async_start_func_win, 0))
+# define async_fibre_free(f)             (DeleteFiber((f)->fibre))
+
+async_ctx *async_get_ctx(void);
+int async_set_ctx(async_ctx *ctx);
+
+int async_fibre_init_dispatcher(async_fibre *fibre);
+VOID CALLBACK async_start_func_win(PVOID unused);
 
-int ASYNC_FIBRE_init_dispatcher(ASYNC_FIBRE *fibre);
-VOID CALLBACK ASYNC_start_func_win(PVOID unused);
+async_pool *async_get_pool(void);
+int async_set_pool(async_pool *pool);
 
 #endif