From 101c1b6a946d9f2f48c6dd89940ae669141e0511 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 22 Dec 2016 01:57:10 -0800 Subject: Use C99 structure initializers FTW. Various other changes. --- src/platform/posix/posix_impl.h | 42 +++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) (limited to 'src/platform/posix/posix_impl.h') diff --git a/src/platform/posix/posix_impl.h b/src/platform/posix/posix_impl.h index c18af983..0a3151f3 100644 --- a/src/platform/posix/posix_impl.h +++ b/src/platform/posix/posix_impl.h @@ -1,21 +1,14 @@ -/* - * Copyright 2016 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. - */ +// +// Copyright 2016 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. +// -/* - * This is more of a direct #include of a .c rather than .h file. - * But having it be a .h makes compiler rules work out properly. Do - * not include this more than once into your program, or you will - * get multiple symbols defined. - * - * The file itself pulls in POSIX implementations for platform specific - * functionality. - */ +#ifndef PLATFORM_POSIX_IMPL_H +#define PLATFORM_POSIX_IMPL_H #ifdef PLATFORM_POSIX #define PLATFORM_POSIX_ALLOC @@ -23,7 +16,20 @@ #define PLATFORM_POSIX_CLOCK #define PLATFORM_POSIX_SYNCH #define PLATFORM_POSIX_THREAD -#define PLATFORM_POSIX_VSNPRINTF #include "platform/posix/posix_config.h" #endif + +// Define types that this platform uses. +#ifdef PLATFORM_POSIX_SYNCH +struct nni_mutex { + pthread_mutex_t mx; +} + +struct nni_condvar { + pthread_cond_t cv; + pthread_mutex_t * mx; +} +#endif + +#endif // PLATFORM_POSIX_IMPL_H \ No newline at end of file -- cgit v1.2.3-70-g09d2