From c6f7f5777694c448aa42d17f88ab9cf2e3112dd0 Mon Sep 17 00:00:00 2001 From: Caleb Xu Date: Mon, 16 May 2022 22:31:39 -0400 Subject: [PATCH] apple/Throw: add missing header strlen() and strcpy() are provided by the and headers (as functions in global and std namespaces, respectively). Compilers MAY provide an implementation for either of the functions without including the extra header but the existence of a declaration without the header is not assured. --- src/apple/Throw.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/apple/Throw.cxx b/src/apple/Throw.cxx index 9f6fd7a58..9bc27b7d0 100644 --- a/src/apple/Throw.cxx +++ b/src/apple/Throw.cxx @@ -31,6 +31,7 @@ #include "ErrorRef.hxx" #include "StringRef.hxx" +#include #include namespace Apple { @@ -57,8 +58,8 @@ ThrowOSStatus(OSStatus status, const char *_msg) const Apple::StringRef cfstr(cferr.CopyDescription()); char msg[1024]; - strcpy(msg, _msg); - size_t length = strlen(msg); + std::strcpy(msg, _msg); + size_t length = std::strlen(msg); cfstr.GetCString(msg + length, sizeof(msg) - length); throw std::runtime_error(msg);