Boost logo

Boost Users :

Subject: [Boost-users] [Interprocess] WIN32 define case unaccessible ?
From: Antoine Pédron (antoine_at_[hidden])
Date: 2013-02-09 12:07:52


Hello,

I'm using Boost.Interprocess in order to get a single portable source
code between Windows and Linux using Mutexes and Shared Memory.

Documentation says that, for Windows, the API default behaviour is
emulation with mapped files, which is the case (:D). Though, having a
look at interprocess' headers, i encountrered this case :

from D:\Libraries\boost\boost_1_51\boost\interprocess\sync\named_mutex.hpp :
____________________________________________________________________________

#if defined(BOOST_INTERPROCESS_NAMED_MUTEX_USES_POSIX_SEMAPHORES)
   #include <boost/interprocess/sync/posix/named_mutex.hpp>
   #define BOOST_INTERPROCESS_USE_POSIX_SEMAPHORES
#elif !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined
(BOOST_INTERPROCESS_WINDOWS)
   #include <boost/interprocess/sync/windows/named_mutex.hpp>
   #define BOOST_INTERPROCESS_USE_WINDOWS
#else
#include <boost/interprocess/sync/shm/named_mutex.hpp>
#endif
____________________________________________________________________________

A case where BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION is not defined
and BOOST_INTERPROCESS_WINDOWS is, meaning that i can use Windows
standard API.

My problem is that i want to use this case and i wonder how to reach
it. The former file includes boost/interprocess/detail/workaround.hpp
where both symbols are defined :
____________________________________________________________________________
#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
   #define BOOST_INTERPROCESS_WINDOWS
   #define BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION
   #define BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME
____________________________________________________________________________

and i can't see an #undef anywhere to get into the case i want.

Thanks in advance,
Antoine


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net