diff --git a/Subtrees/beast/modules/beast_core/native/beast_posix_NamedPipe.cpp b/Subtrees/beast/modules/beast_core/native/beast_posix_NamedPipe.cpp index a43ada5a1..07c2725d6 100644 --- a/Subtrees/beast/modules/beast_core/native/beast_posix_NamedPipe.cpp +++ b/Subtrees/beast/modules/beast_core/native/beast_posix_NamedPipe.cpp @@ -32,7 +32,7 @@ public: stopReadOperation (false) { signal (SIGPIPE, signalHandler); - siginterrupt (SIGPIPE, 1); + beast_siginterrupt (SIGPIPE, 1); } ~Pimpl() diff --git a/Subtrees/beast/modules/beast_core/native/beast_posix_SharedCode.h b/Subtrees/beast/modules/beast_core/native/beast_posix_SharedCode.h index 6ba80516a..936be35f4 100644 --- a/Subtrees/beast/modules/beast_core/native/beast_posix_SharedCode.h +++ b/Subtrees/beast/modules/beast_core/native/beast_posix_SharedCode.h @@ -174,6 +174,21 @@ bool File::setAsCurrentWorkingDirectory() const return chdir (getFullPathName().toUTF8()) == 0; } +//============================================================================== +// The unix siginterrupt function is deprecated - this does the same job. +int beast_siginterrupt (int sig, int flag) +{ + struct ::sigaction act; + (void) ::sigaction (sig, nullptr, &act); + + if (flag != 0) + act.sa_flags &= ~SA_RESTART; + else + act.sa_flags |= SA_RESTART; + + return ::sigaction (sig, &act, nullptr); +} + //============================================================================== namespace { diff --git a/Subtrees/beast/modules/beast_core/system/beast_PlatformDefs.h b/Subtrees/beast/modules/beast_core/system/beast_PlatformDefs.h index 272a916c5..9af6796ec 100644 --- a/Subtrees/beast/modules/beast_core/system/beast_PlatformDefs.h +++ b/Subtrees/beast/modules/beast_core/system/beast_PlatformDefs.h @@ -209,13 +209,15 @@ template <> struct BeastStaticAssert { static void dummy() {} }; //------------------------------------------------------------------------------ // Cross-compiler deprecation macros.. -#if DOXYGEN || (BEAST_MSVC && ! BEAST_NO_DEPRECATION_WARNINGS) -/** This can be used to wrap a function which has been deprecated. */ -# define BEAST_DEPRECATED(functionDef) __declspec(deprecated) functionDef -#elif BEAST_GCC && ! BEAST_NO_DEPRECATION_WARNINGS -# define BEAST_DEPRECATED(functionDef) functionDef __attribute__ ((deprecated)) +#ifdef DOXYGEN + /** This macro can be used to wrap a function which has been deprecated. */ + #define BEAST_DEPRECATED(functionDef) +#elif BEAST_MSVC && ! BEAST_NO_DEPRECATION_WARNINGS + #define BEAST_DEPRECATED(functionDef) __declspec(deprecated) functionDef +#elif BEAST_GCC && ! BEAST_NO_DEPRECATION_WARNINGS + #define BEAST_DEPRECATED(functionDef) functionDef __attribute__ ((deprecated)) #else -# define BEAST_DEPRECATED(functionDef) functionDef + #define BEAST_DEPRECATED(functionDef) functionDef #endif //------------------------------------------------------------------------------ diff --git a/Subtrees/beast/modules/beast_core/system/beast_SystemStats.cpp b/Subtrees/beast/modules/beast_core/system/beast_SystemStats.cpp index 81d3b5e1c..1e50c7176 100644 --- a/Subtrees/beast/modules/beast_core/system/beast_SystemStats.cpp +++ b/Subtrees/beast/modules/beast_core/system/beast_SystemStats.cpp @@ -79,7 +79,7 @@ String SystemStats::getStackBacktrace() int frames = (int) CaptureStackBackTrace (0, numElementsInArray (stack), stack, nullptr); HeapBlock symbol; - symbol.calloc (sizeof(SYMBOL_INFO) + 256, 1); + symbol.calloc (sizeof (SYMBOL_INFO) + 256, 1); symbol->MaxNameLen = 255; symbol->SizeOfStruct = sizeof (SYMBOL_INFO); @@ -131,6 +131,8 @@ static void handleCrash (int) globalCrashHandler(); kill (getpid(), SIGKILL); } + +int beast_siginterrupt (int sig, int flag); #endif void SystemStats::setApplicationCrashHandler (CrashHandlerFunction handler) @@ -146,7 +148,7 @@ void SystemStats::setApplicationCrashHandler (CrashHandlerFunction handler) for (int i = 0; i < numElementsInArray (signals); ++i) { ::signal (signals[i], handleCrash); - ::siginterrupt (signals[i], 1); + beast_siginterrupt (signals[i], 1); } #endif } diff --git a/Subtrees/beast/modules/beast_core/text/beast_String.h b/Subtrees/beast/modules/beast_core/text/beast_String.h index 3a4ba8df9..e3c41b651 100644 --- a/Subtrees/beast/modules/beast_core/text/beast_String.h +++ b/Subtrees/beast/modules/beast_core/text/beast_String.h @@ -1219,7 +1219,7 @@ private: explicit String (const PreallocationBytes&); // This constructor preallocates a certain amount of memory void appendFixedLength (const char* text, int numExtraChars); size_t getByteOffsetOfEnd() const noexcept; - BEAST_DEPRECATED (String (const String& stringToCopy, size_t charsToAllocate)); + BEAST_DEPRECATED (String (const String&, size_t)); // This private cast operator should prevent strings being accidentally cast // to bools (this is possible because the compiler can add an implicit cast