diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-01-03 23:50:12 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-01-03 23:50:12 -0800 |
| commit | 856c5c8e2aa4e07b2b628dd194a63ae13dae7ae3 (patch) | |
| tree | 881df2438f89137f014d1706124b58d40115a47d /src/platform/posix/posix_impl.h | |
| parent | 7ba8f81d551af515864c2c4ca47edf540a5edd32 (diff) | |
| download | nng-856c5c8e2aa4e07b2b628dd194a63ae13dae7ae3.tar.gz nng-856c5c8e2aa4e07b2b628dd194a63ae13dae7ae3.tar.bz2 nng-856c5c8e2aa4e07b2b628dd194a63ae13dae7ae3.zip | |
Working towards TCP support.
Diffstat (limited to 'src/platform/posix/posix_impl.h')
| -rw-r--r-- | src/platform/posix/posix_impl.h | 29 |
1 files changed, 14 insertions, 15 deletions
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 <pthread.h> +#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 <pthread.h> // These types are provided for here, to permit them to be directly inlined // elsewhere. |
