diff --git a/src/beast/Builds/VisualStudio2013/beast.vcxproj b/src/beast/Builds/VisualStudio2013/beast.vcxproj index dec4c069ca..fdd8dc9781 100644 --- a/src/beast/Builds/VisualStudio2013/beast.vcxproj +++ b/src/beast/Builds/VisualStudio2013/beast.vcxproj @@ -248,6 +248,7 @@ + diff --git a/src/beast/Builds/VisualStudio2013/beast.vcxproj.filters b/src/beast/Builds/VisualStudio2013/beast.vcxproj.filters index 02791a4844..3a52abd381 100644 --- a/src/beast/Builds/VisualStudio2013/beast.vcxproj.filters +++ b/src/beast/Builds/VisualStudio2013/beast.vcxproj.filters @@ -315,6 +315,9 @@ {f2594738-6447-447b-8f51-2d42fbe8a6ee} + + {84acd0d5-5531-470e-b9a7-42af9003aa64} + @@ -1323,6 +1326,12 @@ beast\http + + beast\container + + + beast\workaround + diff --git a/src/beast/beast/Arithmetic.h b/src/beast/beast/Arithmetic.h index 8aba10345d..54357c8dd4 100644 --- a/src/beast/beast/Arithmetic.h +++ b/src/beast/beast/Arithmetic.h @@ -27,6 +27,8 @@ #include "Config.h" #include "CStdInt.h" +#include "workaround/noexcept.h" + #include #include diff --git a/src/beast/beast/Atomic.h b/src/beast/beast/Atomic.h index e64debf0b3..e214a20864 100644 --- a/src/beast/beast/Atomic.h +++ b/src/beast/beast/Atomic.h @@ -28,6 +28,8 @@ #include "CStdInt.h" #include "StaticAssert.h" +#include "workaround/noexcept.h" + namespace beast { //============================================================================== diff --git a/src/beast/beast/asio/buffer_sequence.h b/src/beast/beast/asio/buffer_sequence.h index 3efec2230d..cef30457bf 100644 --- a/src/beast/beast/asio/buffer_sequence.h +++ b/src/beast/beast/asio/buffer_sequence.h @@ -22,6 +22,7 @@ #include +#include "../workaround/noexcept.h" #include #include #include "../cxx14/type_traits.h" // diff --git a/src/beast/beast/asio/memory_buffer.h b/src/beast/beast/asio/memory_buffer.h index 91e2029a69..1151e865bb 100644 --- a/src/beast/beast/asio/memory_buffer.h +++ b/src/beast/beast/asio/memory_buffer.h @@ -24,6 +24,7 @@ #include +#include "../workaround/noexcept.h" #include #include #include diff --git a/src/beast/beast/asio/shared_handler.h b/src/beast/beast/asio/shared_handler.h index 78e56d19c4..b327e1498a 100644 --- a/src/beast/beast/asio/shared_handler.h +++ b/src/beast/beast/asio/shared_handler.h @@ -24,16 +24,16 @@ #include "../mpl/IsCallPossible.h" -#include -#include -#include "../cxx14/type_traits.h" // - #include - #include #include #include +#include "../workaround/noexcept.h" +#include +#include +#include "../cxx14/type_traits.h" // + #ifndef BEAST_ASIO_NO_ALLOCATE_SHARED #define BEAST_ASIO_NO_ALLOCATE_SHARED 0 #endif diff --git a/src/beast/beast/asio/socket_wrapper.h b/src/beast/beast/asio/socket_wrapper.h index 136ad0898d..2a6df8e9ba 100644 --- a/src/beast/beast/asio/socket_wrapper.h +++ b/src/beast/beast/asio/socket_wrapper.h @@ -23,6 +23,8 @@ #include "abstract_socket.h" #include "bind_handler.h" +#include "../workaround/noexcept.h" + namespace beast { namespace asio { diff --git a/src/beast/beast/chrono/RelativeTime.h b/src/beast/beast/chrono/RelativeTime.h index 41a65df625..d0c2665cbf 100644 --- a/src/beast/beast/chrono/RelativeTime.h +++ b/src/beast/beast/chrono/RelativeTime.h @@ -27,6 +27,7 @@ #include "../Config.h" #include "../strings/String.h" +#include "../workaround/noexcept.h" #include #include diff --git a/src/beast/beast/chrono/abstract_clock.h b/src/beast/beast/chrono/abstract_clock.h index 170e663a70..54c19444ca 100644 --- a/src/beast/beast/chrono/abstract_clock.h +++ b/src/beast/beast/chrono/abstract_clock.h @@ -20,10 +20,11 @@ #ifndef BEAST_CHRONO_ABSTRACT_CLOCK_H_INCLUDED #define BEAST_CHRONO_ABSTRACT_CLOCK_H_INCLUDED -#include - #include "chrono_io.h" +#include +#include + namespace beast { /** Abstract interface to a clock. diff --git a/src/beast/beast/chrono/chrono_io.h b/src/beast/beast/chrono/chrono_io.h index bfbcd92cc0..a5bf2f19b8 100644 --- a/src/beast/beast/chrono/chrono_io.h +++ b/src/beast/beast/chrono/chrono_io.h @@ -29,6 +29,7 @@ #include "../Config.h" +#include "../workaround/noexcept.h" #include #include diff --git a/src/beast/beast/config/CompilerConfig.h b/src/beast/beast/config/CompilerConfig.h index 6b42d30277..534588f7c3 100644 --- a/src/beast/beast/config/CompilerConfig.h +++ b/src/beast/beast/config/CompilerConfig.h @@ -278,35 +278,10 @@ extern void beast_reportFatalError (char const* message, char const* fileName, i # define BEAST_MOVE_CAST(type) type #endif -//------------------------------------------------------------------------------ - -// Declare some fake versions of nullptr and noexcept, for older compilers: -#if ! (DOXYGEN || BEAST_COMPILER_SUPPORTS_NOEXCEPT) -# ifdef noexcept -# undef noexcept -# endif -# define noexcept throw() -# if defined (_MSC_VER) && _MSC_VER > 1600 -# define _ALLOW_KEYWORD_MACROS 1 // (to stop VC2012 complaining) -# endif -#endif - -#if ! (DOXYGEN || BEAST_COMPILER_SUPPORTS_NULLPTR) -#ifdef nullptr -#undef nullptr -#endif -#define nullptr (0) -#endif - -#if ! (DOXYGEN || BEAST_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL) -#undef override -#define override -#endif - #ifdef __cplusplus namespace beast { bool beast_isRunningUnderDebugger(); -void logAssertion (char const* file, int line) noexcept; +void logAssertion (char const* file, int line); } #endif diff --git a/src/beast/beast/config/compiler/VisualC.h b/src/beast/beast/config/compiler/VisualC.h index 38468c18ce..6ca2d106e9 100644 --- a/src/beast/beast/config/compiler/VisualC.h +++ b/src/beast/beast/config/compiler/VisualC.h @@ -19,6 +19,4 @@ // Microsoft Visual C++ compiler configuration -#ifndef noexcept -# define noexcept throw() -#endif +#include "../../workaround/noexcept.h" diff --git a/src/beast/beast/utility/empty_base_optimization.h b/src/beast/beast/utility/empty_base_optimization.h index fd8bffa3b9..39f8d6895f 100644 --- a/src/beast/beast/utility/empty_base_optimization.h +++ b/src/beast/beast/utility/empty_base_optimization.h @@ -20,6 +20,7 @@ #ifndef BEAST_UTILITY_EMPTY_BASE_OPTIMIZATION_H_INCLUDED #define BEAST_UTILITY_EMPTY_BASE_OPTIMIZATION_H_INCLUDED +#include "../workaround/noexcept.h" #include #include diff --git a/src/beast/beast/workaround/noexcept.h b/src/beast/beast/workaround/noexcept.h new file mode 100644 index 0000000000..79e3a20888 --- /dev/null +++ b/src/beast/beast/workaround/noexcept.h @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +/* + This file is part of Beast: https://github.com/vinniefalco/Beast + Copyright 2013, Vinnie Falco + + Portions of this file are from JUCE. + Copyright (c) 2013 - Raw Material Software Ltd. + Please visit http://www.juce.com + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#ifndef BEAST_WORKAROUND_NOEXCEPT_H_INCLUDED +#define BEAST_WORKAROUND_NOEXCEPT_H_INCLUDED + +#ifdef _MSC_VER +# ifdef noexcept +# undef noexcept +# endif +# define noexcept throw() +# if _MSC_VER > 1600 && ! _ALLOW_KEYWORD_MACROS +# define _ALLOW_KEYWORD_MACROS 1 // (to stop VC2012 complaining) +# endif +#endif + +#endif diff --git a/src/beast/modules/beast_core/logging/Logger.cpp b/src/beast/modules/beast_core/logging/Logger.cpp index bb3ed1dad5..ba781879cb 100644 --- a/src/beast/modules/beast_core/logging/Logger.cpp +++ b/src/beast/modules/beast_core/logging/Logger.cpp @@ -47,7 +47,7 @@ void Logger::writeToLog (const String& message) } #if BEAST_LOG_ASSERTIONS || BEAST_DEBUG -void logAssertion (const char* const filename, const int lineNum) noexcept +void logAssertion (const char* const filename, const int lineNum) { String m ("BEAST Assertion failure in "); m << File::createFileWithoutCheckingPath (filename).getFileName() << ':' << lineNum;