// detail/impl/win_static_mutex.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/asio/detail/config.hpp>
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
#include <cstdio>
#include <boost/asio/detail/throw_error.hpp>
{
using namespace std; // For sprintf.
wchar_t mutex_name[128];
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
- swprintf_s(mutex_name, 128,
-#else // BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
- swprintf(mutex_name,
-#endif // BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
- L"asio-58CCDC44-6264-4842-90C2-F3C545CB8AA7-%u-%p",
+#if defined(BOOST_ASIO_HAS_SECURE_RTL)
+ swprintf_s(
+#else // defined(BOOST_ASIO_HAS_SECURE_RTL)
+ _snwprintf(
+#endif // defined(BOOST_ASIO_HAS_SECURE_RTL)
+ mutex_name, 128, L"asio-58CCDC44-6264-4842-90C2-F3C545CB8AA7-%u-%p",
static_cast<unsigned int>(::GetCurrentProcessId()), this);
HANDLE mutex = ::CreateMutexW(0, TRUE, mutex_name);
#include <boost/asio/detail/pop_options.hpp>
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
#endif // BOOST_ASIO_DETAIL_IMPL_WIN_STATIC_MUTEX_IPP