summaryrefslogtreecommitdiff
path: root/src/platform/posix/posix_impl.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2016-12-22 01:57:10 -0800
committerGarrett D'Amore <garrett@damore.org>2016-12-22 01:57:10 -0800
commit101c1b6a946d9f2f48c6dd89940ae669141e0511 (patch)
tree4da688859d87526d03d724ab1a729c6846650eae /src/platform/posix/posix_impl.h
parentb92672e20420683e73bfc017956ac6ef2b6b793b (diff)
downloadnng-101c1b6a946d9f2f48c6dd89940ae669141e0511.tar.gz
nng-101c1b6a946d9f2f48c6dd89940ae669141e0511.tar.bz2
nng-101c1b6a946d9f2f48c6dd89940ae669141e0511.zip
Use C99 structure initializers FTW. Various other changes.
Diffstat (limited to 'src/platform/posix/posix_impl.h')
-rw-r--r--src/platform/posix/posix_impl.h42
1 files changed, 24 insertions, 18 deletions
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 <garrett@damore.org>
- *
- * 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 <garrett@damore.org>
+//
+// 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