summaryrefslogtreecommitdiff
path: root/boost/interprocess/sync/posix/semaphore_wrapper.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/interprocess/sync/posix/semaphore_wrapper.hpp')
-rw-r--r--boost/interprocess/sync/posix/semaphore_wrapper.hpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/boost/interprocess/sync/posix/semaphore_wrapper.hpp b/boost/interprocess/sync/posix/semaphore_wrapper.hpp
index 33f55fae54..ca0f519b68 100644
--- a/boost/interprocess/sync/posix/semaphore_wrapper.hpp
+++ b/boost/interprocess/sync/posix/semaphore_wrapper.hpp
@@ -11,7 +11,11 @@
#ifndef BOOST_INTERPROCESS_POSIX_SEMAPHORE_WRAPPER_HPP
#define BOOST_INTERPROCESS_POSIX_SEMAPHORE_WRAPPER_HPP
-#if defined(_MSC_VER)
+#ifndef BOOST_CONFIG_HPP
+# include <boost/config.hpp>
+#endif
+#
+#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
@@ -47,6 +51,8 @@ namespace boost {
namespace interprocess {
namespace ipcdetail {
+#ifdef BOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES
+
inline bool semaphore_open
(sem_t *&handle, create_enum_t type, const char *origname,
unsigned int count = 0, const permissions &perm = permissions())
@@ -130,6 +136,10 @@ inline bool semaphore_unlink(const char *semname)
}
}
+#endif //BOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES
+
+#ifdef BOOST_INTERPROCESS_POSIX_UNNAMED_SEMAPHORES
+
inline void semaphore_init(sem_t *handle, unsigned int initialCount)
{
int ret = sem_init(handle, 1, initialCount);
@@ -150,6 +160,8 @@ inline void semaphore_destroy(sem_t *handle)
}
}
+#endif //BOOST_INTERPROCESS_POSIX_UNNAMED_SEMAPHORES
+
inline void semaphore_post(sem_t *handle)
{
int ret = sem_post(handle);