From 856c5c8e2aa4e07b2b628dd194a63ae13dae7ae3 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 3 Jan 2017 23:50:12 -0800 Subject: Working towards TCP support. --- src/platform/posix/posix_impl.h | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 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 5c5c3798..38fe27c9 100644 --- a/src/platform/posix/posix_impl.h +++ b/src/platform/posix/posix_impl.h @@ -12,35 +12,34 @@ // Some dependency notes: // -// PLATFORM_POSIX_THREAD and PLATFORM_POSIX_SYNCH depend on each other, -// and they both depend on PLATFORM_POSIX_CLOCK. Furthermore, note that +// PLATFORM_POSIX_THREAD depends on PLATFORM_POSIX_CLOCK. Furthermore, // when using PLATFORM_POSIX_CLOCK, your condition variable timeouts need -// to use the same base clock values. Normally all three should be used -// together. +// to use the same base clock values. Normally these should be used +// together. Almost everything depends on PLATFORM_POSIX_DEBUG. #ifdef PLATFORM_POSIX #define PLATFORM_POSIX_ALLOC #define PLATFORM_POSIX_DEBUG #define PLATFORM_POSIX_CLOCK +#define PLATFORM_POSIX_NET #define PLATFORM_POSIX_RANDOM -#define PLATFORM_POSIX_SYNCH #define PLATFORM_POSIX_THREAD #include "platform/posix/posix_config.h" #endif -// Define types that this platform uses. -#ifdef PLATFORM_POSIX_SYNCH +#ifdef PLATFORM_POSIX_DEBUG +extern int nni_plat_errno(int); -#include +#endif -struct nni_mutex { - pthread_mutex_t mx; -}; +#ifdef PLATFORM_POSIX_NET +typedef int nni_plat_tcpsock; +#endif -struct nni_cond { - pthread_cond_t cv; - pthread_mutex_t * mx; -}; +// Define types that this platform uses. +#ifdef PLATFORM_POSIX_THREAD + +#include // These types are provided for here, to permit them to be directly inlined // elsewhere. -- cgit v1.2.3-70-g09d2