From 2bb6a23037656474a90d869c5147b32bae1a2e40 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 12 Jan 2017 20:46:20 -0800 Subject: Initial swag at Win32. Much to do still. --- src/platform/windows/win_impl.h | 58 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/platform/windows/win_impl.h (limited to 'src/platform/windows/win_impl.h') diff --git a/src/platform/windows/win_impl.h b/src/platform/windows/win_impl.h new file mode 100644 index 00000000..1b306f8f --- /dev/null +++ b/src/platform/windows/win_impl.h @@ -0,0 +1,58 @@ +// +// Copyright 2017 Garrett D'Amore +// +// This software is supplied under the terms of the MIT License, a +// copy of which should be located in the distribution where this +// file was obtained (LICENSE.txt). A copy of the license may also be +// found online at https://opensource.org/licenses/MIT. +// + +#ifndef PLATFORM_WIN_IMPL_H +#define PLATFORM_WIN_IMPL_H + +#ifdef PLATFORM_WINDOWS + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#include +#include +#include +#include +#include + + +// These types are provided for here, to permit them to be directly inlined +// elsewhere. + +struct nni_plat_tcpsock { + SOCKET s; +}; + +struct nni_plat_ipcsock { + HANDLE p; +} + +struct nni_plat_thr { + void (__stdcall *func)(void *); + void * arg; + HANDLE handle; +}; + +struct nni_plat_mtx { + CRITICAL_SECTION cs; + DWORD owner; +}; + +struct nni_plat_cv { + CONDITION_VARIABLE cv; + CRITICAL_SECTION cs; +}; + +#define nni_alloc(s) calloc(1, (s)) +#define nni_free(s, z) free(s) + +#endif // PLATFORM_WINDOWS + +#endif // PLATFORM_WIN_IMPL_H -- cgit v1.2.3-70-g09d2