Skip to content

Commit 788be20

Browse files
committed
Replace BOOST_MSVC with ASIO_MSVC.
1 parent 2c0aa5e commit 788be20

File tree

10 files changed

+33
-26
lines changed

10 files changed

+33
-26
lines changed

asio/include/asio/basic_socket.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ class basic_socket
394394
* CancelIoEx function is always used. This function does not have the
395395
* problems described above.
396396
*/
397-
#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1400) \
397+
#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \
398398
&& (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \
399399
&& !defined(ASIO_ENABLE_CANCELIO)
400400
__declspec(deprecated("By default, this function always fails with "
@@ -442,7 +442,7 @@ class basic_socket
442442
* CancelIoEx function is always used. This function does not have the
443443
* problems described above.
444444
*/
445-
#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1400) \
445+
#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1400) \
446446
&& (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \
447447
&& !defined(ASIO_ENABLE_CANCELIO)
448448
__declspec(deprecated("By default, this function always fails with "

asio/include/asio/buffer.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
#include <boost/detail/workaround.hpp>
2424
#include "asio/detail/array_fwd.hpp"
2525

26-
#if defined(BOOST_MSVC)
26+
#if defined(ASIO_MSVC)
2727
# if defined(_HAS_ITERATOR_DEBUGGING) && (_HAS_ITERATOR_DEBUGGING != 0)
2828
# if !defined(ASIO_DISABLE_BUFFER_DEBUGGING)
2929
# define ASIO_ENABLE_BUFFER_DEBUGGING
3030
# endif // !defined(ASIO_DISABLE_BUFFER_DEBUGGING)
3131
# endif // defined(_HAS_ITERATOR_DEBUGGING)
32-
#endif // defined(BOOST_MSVC)
32+
#endif // defined(ASIO_MSVC)
3333

3434
#if defined(__GNUC__)
3535
# if defined(_GLIBCXX_DEBUG)
@@ -511,12 +511,12 @@ class buffer_debug_check
511511

512512
~buffer_debug_check()
513513
{
514-
#if BOOST_WORKAROUND(BOOST_MSVC, == 1400)
514+
#if BOOST_WORKAROUND(ASIO_MSVC, == 1400)
515515
// MSVC 8's string iterator checking may crash in a std::string::iterator
516516
// object's destructor when the iterator points to an already-destroyed
517517
// std::string object, unless the iterator is cleared first.
518518
iter_ = Iterator();
519-
#endif // BOOST_WORKAROUND(BOOST_MSVC, == 1400)
519+
#endif // BOOST_WORKAROUND(ASIO_MSVC, == 1400)
520520
}
521521

522522
void operator()()

asio/include/asio/detail/config.hpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@
4747
# define ASIO_DECL
4848
#endif // !defined(ASIO_DECL)
4949

50+
// Microsoft Visual C++ detection.
51+
#if defined(BOOST_MSVC)
52+
# define ASIO_MSVC BOOST_MSVC
53+
#elif defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__EDG_VERSION__)
54+
# define ASIO_MSVC _MSC_VER
55+
#endif // defined(BOOST_MSVC)
56+
5057
// Support move construction and assignment on compilers known to allow it.
5158
#if !defined(ASIO_DISABLE_MOVE)
5259
# if defined(__GNUC__)
@@ -78,7 +85,7 @@
7885
# else // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
7986
# define ASIO_MOVE_ARG(type) type
8087
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
81-
# elif defined(BOOST_MSVC)
88+
# elif defined(ASIO_MSVC)
8289
# if (_MSC_VER >= 1400)
8390
# define ASIO_MOVE_ARG(type) const type&
8491
# else // (_MSC_VER >= 1400)
@@ -135,11 +142,11 @@
135142
# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
136143
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
137144
# endif // defined(__GNUC__)
138-
# if defined(BOOST_MSVC)
145+
# if defined(ASIO_MSVC)
139146
# if (_MSC_VER >= 1600)
140147
# define ASIO_HAS_STD_ARRAY
141148
# endif // (_MSC_VER >= 1600)
142-
# endif // defined(BOOST_MSVC)
149+
# endif // defined(ASIO_MSVC)
143150
#endif // !defined(ASIO_DISABLE_STD_ARRAY)
144151

145152
// Standard library support for shared_ptr and weak_ptr.
@@ -151,11 +158,11 @@
151158
# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
152159
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
153160
# endif // defined(__GNUC__)
154-
# if defined(BOOST_MSVC)
161+
# if defined(ASIO_MSVC)
155162
# if (_MSC_VER >= 1600)
156163
# define ASIO_HAS_STD_SHARED_PTR
157164
# endif // (_MSC_VER >= 1600)
158-
# endif // defined(BOOST_MSVC)
165+
# endif // defined(ASIO_MSVC)
159166
#endif // !defined(ASIO_DISABLE_STD_SHARED_PTR)
160167

161168
// Standard library support for atomic operations.

asio/include/asio/detail/handler_type_requirements.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
3838
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
3939
# endif // defined(__GNUC__)
40-
# if defined(BOOST_MSVC)
40+
# if defined(ASIO_MSVC)
4141
# if (_MSC_VER >= 1600)
4242
# define ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1
4343
# endif // (_MSC_VER >= 1600)
44-
# endif // defined(BOOST_MSVC)
44+
# endif // defined(ASIO_MSVC)
4545
#endif // !defined(ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS)
4646

4747
namespace asio {

asio/include/asio/detail/impl/handler_tracking.ipp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,11 @@ void handler_tracking::write_line(const char* format, ...)
270270
va_start(args, format);
271271

272272
char line[256] = "";
273-
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
273+
#if BOOST_WORKAROUND(ASIO_MSVC, >= 1400) && !defined(UNDER_CE)
274274
int length = vsprintf_s(line, sizeof(line), format, args);
275-
#else // BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
275+
#else // BOOST_WORKAROUND(ASIO_MSVC, >= 1400) && !defined(UNDER_CE)
276276
int length = vsprintf(line, format, args);
277-
#endif // BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
277+
#endif // BOOST_WORKAROUND(ASIO_MSVC, >= 1400) && !defined(UNDER_CE)
278278

279279
va_end(args);
280280

asio/include/asio/detail/impl/socket_ops.ipp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2240,7 +2240,7 @@ inline void gai_free(void* p)
22402240
inline void gai_strcpy(char* target, const char* source, std::size_t max_size)
22412241
{
22422242
using namespace std;
2243-
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
2243+
#if BOOST_WORKAROUND(ASIO_MSVC, >= 1400) && !defined(UNDER_CE)
22442244
strcpy_s(target, max_size, source);
22452245
#else
22462246
*target = 0;
@@ -2779,7 +2779,7 @@ inline asio::error_code getnameinfo_emulation(
27792779
{
27802780
return ec = asio::error::no_buffer_space;
27812781
}
2782-
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
2782+
#if BOOST_WORKAROUND(ASIO_MSVC, >= 1400) && !defined(UNDER_CE)
27832783
sprintf_s(serv, servlen, "%u", ntohs(port));
27842784
#else
27852785
sprintf(serv, "%u", ntohs(port));
@@ -2802,7 +2802,7 @@ inline asio::error_code getnameinfo_emulation(
28022802
{
28032803
return ec = asio::error::no_buffer_space;
28042804
}
2805-
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
2805+
#if BOOST_WORKAROUND(ASIO_MSVC, >= 1400) && !defined(UNDER_CE)
28062806
sprintf_s(serv, servlen, "%u", ntohs(port));
28072807
#else
28082808
sprintf(serv, "%u", ntohs(port));

asio/include/asio/detail/impl/win_static_mutex.ipp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ int win_static_mutex::do_init()
4141
{
4242
using namespace std; // For sprintf.
4343
wchar_t mutex_name[128];
44-
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
44+
#if BOOST_WORKAROUND(ASIO_MSVC, >= 1400) && !defined(UNDER_CE)
4545
swprintf_s(mutex_name, 128,
46-
#else // BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
46+
#else // BOOST_WORKAROUND(ASIO_MSVC, >= 1400) && !defined(UNDER_CE)
4747
swprintf(mutex_name,
48-
#endif // BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
48+
#endif // BOOST_WORKAROUND(ASIO_MSVC, >= 1400) && !defined(UNDER_CE)
4949
L"asio-58CCDC44-6264-4842-90C2-F3C545CB8AA7-%u-%p",
5050
static_cast<unsigned int>(::GetCurrentProcessId()), this);
5151

asio/include/asio/detail/win_fenced_block.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class win_fenced_block
4444
#if defined(__BORLANDC__)
4545
LONG barrier = 0;
4646
::InterlockedExchange(&barrier, 1);
47-
#elif defined(BOOST_MSVC) && ((BOOST_MSVC < 1400) || !defined(MemoryBarrier))
47+
#elif defined(ASIO_MSVC) && ((ASIO_MSVC < 1400) || !defined(MemoryBarrier))
4848
# if defined(_M_IX86)
4949
# pragma warning(push)
5050
# pragma warning(disable:4793)
@@ -63,7 +63,7 @@ class win_fenced_block
6363
#if defined(__BORLANDC__)
6464
LONG barrier = 0;
6565
::InterlockedExchange(&barrier, 1);
66-
#elif defined(BOOST_MSVC) && ((BOOST_MSVC < 1400) || !defined(MemoryBarrier))
66+
#elif defined(ASIO_MSVC) && ((ASIO_MSVC < 1400) || !defined(MemoryBarrier))
6767
# if defined(_M_IX86)
6868
# pragma warning(push)
6969
# pragma warning(disable:4793)

asio/include/asio/placeholders.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ namespace detail
8383
};
8484
}
8585

86-
#if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
86+
#if BOOST_WORKAROUND(ASIO_MSVC, < 1400)
8787

8888
static boost::arg<1>& error
8989
= asio::placeholders::detail::placeholder<1>::get();

asio/include/asio/ssl/impl/context.ipp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ int context::password_callback_function(
502502
std::string passwd = callback->call(static_cast<std::size_t>(size),
503503
purpose ? context_base::for_writing : context_base::for_reading);
504504

505-
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
505+
#if BOOST_WORKAROUND(ASIO_MSVC, >= 1400) && !defined(UNDER_CE)
506506
strcpy_s(buf, size, passwd.c_str());
507507
#else
508508
*buf = '\0';

0 commit comments

Comments
 (0)