================ @@ -0,0 +1,81 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +/// +/// \file +/// This file contains the implementation of strcpy_s. +/// +//===----------------------------------------------------------------------===// + +#include "src/string/strcpy_s.h" +#define __STDC_WANT_LIB_EXT1__ 1 +#include "hdr/stdint_proxy.h" +#undef __STDC_WANT_LIB_EXT1__ +#include "hdr/types/constraint_handler_t.h" +#include "hdr/types/errno_t.h" +#include "hdr/types/rsize_t.h" +#include "src/__support/CPP/expected.h" +#include "src/__support/common.h" +#include "src/__support/constraint_handler.h" +#include "src/__support/macros/config.h" +#include "src/string/memory_utils/inline_memcpy.h" +#include "src/string/string_utils.h" + +namespace LIBC_NAMESPACE_DECL { + +LIBC_INLINE static cpp::expected<size_t, const char *> ---------------- kaladron wrote:
What do you think about returning an errno_t, const char* pair for the unexpected? That would let you return specific error codes, like ERANGE for overflow or EINVAL on the nullpointers or 0 s1max? https://github.com/llvm/llvm-project/pull/197709 _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
