Imported Upstream version 1.57.0
[platform/upstream/boost.git] / boost / asio / detail / impl / win_static_mutex.ipp
index 3ec104d..84bd454 100644 (file)
@@ -2,7 +2,7 @@
 // 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)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
 
 #include <cstdio>
 #include <boost/asio/detail/throw_error.hpp>
@@ -42,12 +42,12 @@ int win_static_mutex::do_init()
 {
   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);
@@ -115,6 +115,6 @@ int win_static_mutex::do_init()
 
 #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