diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-08-20 10:31:09 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-08-21 07:18:30 -0700 |
| commit | 6305e16ab64e42fd9791819d416a6e3534439b0b (patch) | |
| tree | 8dbb42a07140f0c12a61bf6d6bcf9590f8678ae6 /src/platform/posix/posix_impl.h | |
| parent | dd2eda5a90ab86bbde1a9da481a423d367586a73 (diff) | |
| download | nng-6305e16ab64e42fd9791819d416a6e3534439b0b.tar.gz nng-6305e16ab64e42fd9791819d416a6e3534439b0b.tar.bz2 nng-6305e16ab64e42fd9791819d416a6e3534439b0b.zip | |
Conditional platform inclusion cleanups.
We only compile files that are appropriate for the platform. (We
still have guards in place, to allow for a future single .C file
to be built from all the sources.) We also remove the subsystem defines;
if a new platform needs to deviate from POSIX in ways beyond what we
intended here, then that platform should just copy those parts into
a new platform directory, rather than cross including portions from
POSIX.
Diffstat (limited to 'src/platform/posix/posix_impl.h')
| -rw-r--r-- | src/platform/posix/posix_impl.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/platform/posix/posix_impl.h b/src/platform/posix/posix_impl.h index 81fbd48b..0f238e45 100644 --- a/src/platform/posix/posix_impl.h +++ b/src/platform/posix/posix_impl.h @@ -12,41 +12,41 @@ // Some dependency notes: // -// PLATFORM_POSIX_THREAD depends on PLATFORM_POSIX_CLOCK. Furthermore, -// when using PLATFORM_POSIX_CLOCK, your condition variable timeouts need +// NNG_PLATFORM_POSIX_THREAD depends on NNG_PLATFORM_POSIX_CLOCK. Also, +// when using NNG_PLATFORM_POSIX_CLOCK, your condition variable timeouts need // 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_IPC -#define PLATFORM_POSIX_TCP -#define PLATFORM_POSIX_PIPE -#define PLATFORM_POSIX_RANDOM -#define PLATFORM_POSIX_SOCKET -#define PLATFORM_POSIX_THREAD -#define PLATFORM_POSIX_PIPEDESC -#define PLATFORM_POSIX_EPDESC -#define PLATFORM_POSIX_SOCKADDR -#define PLATFORM_POSIX_UDP +// together. Almost everything depends on NNG_PLATFORM_POSIX_DEBUG. +#ifdef NNG_PLATFORM_POSIX +#define NNG_PLATFORM_POSIX_ALLOC +#define NNG_PLATFORM_POSIX_DEBUG +#define NNG_PLATFORM_POSIX_CLOCK +#define NNG_PLATFORM_POSIX_IPC +#define NNG_PLATFORM_POSIX_TCP +#define NNG_PLATFORM_POSIX_PIPE +#define NNG_PLATFORM_POSIX_RANDOM +#define NNG_PLATFORM_POSIX_SOCKET +#define NNG_PLATFORM_POSIX_THREAD +#define NNG_PLATFORM_POSIX_PIPEDESC +#define NNG_PLATFORM_POSIX_EPDESC +#define NNG_PLATFORM_POSIX_SOCKADDR +#define NNG_PLATFORM_POSIX_UDP #include "platform/posix/posix_config.h" #endif -#ifdef PLATFORM_POSIX_SOCKADDR +#ifdef NNG_PLATFORM_POSIX_SOCKADDR #include <sys/socket.h> extern int nni_posix_sockaddr2nn(nni_sockaddr *, const void *); extern int nni_posix_nn2sockaddr(void *, const nni_sockaddr *); #endif -#ifdef PLATFORM_POSIX_DEBUG +#ifdef NNG_PLATFORM_POSIX_DEBUG extern int nni_plat_errno(int); #endif // Define types that this platform uses. -#ifdef PLATFORM_POSIX_THREAD +#ifdef NNG_PLATFORM_POSIX_THREAD #include <pthread.h> |
