From 04381920b62d63b98730dfe3cb4d87771664350f Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Thu, 22 Oct 2026 20:16:11 +0800 Subject: [Support] Add RCCSupport target and naming rules --- rcc/lib/CMakeLists.txt | 5 ++++- rcc/lib/Support/Errno.cc | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'rcc/lib') diff --git a/rcc/lib/CMakeLists.txt b/rcc/lib/CMakeLists.txt index f515bc8..366e6d2 100644 --- a/rcc/lib/CMakeLists.txt +++ b/rcc/lib/CMakeLists.txt @@ -1,3 +1,6 @@ # SPDX-License-Identifier: GPL-3.0-or-later -# Add library subdirectories here as their implementations are introduced. +add_rcc_library(RCCSupport + STATIC + Support/Errno.cc +) diff --git a/rcc/lib/Support/Errno.cc b/rcc/lib/Support/Errno.cc index 5a99571..f0161a6 100644 --- a/rcc/lib/Support/Errno.cc +++ b/rcc/lib/Support/Errno.cc @@ -48,8 +48,8 @@ StrError (int errnum) } #if defined(HAVE_STRERROR_R) || HAVE_DECL_STRERROR_S - const int MaxErrStrLen = 2000; - char buffer[MaxErrStrLen]; + const int maxErrStrLen = 2000; + char buffer[maxErrStrLen]; buffer[0] = '\0'; #endif @@ -58,14 +58,14 @@ StrError (int errnum) #if defined(__GLIBC__) && defined(_GNU_SOURCE) // glibc defines its own incompatible version of strerror_r which may not // use the buffer supplied. - str = strerror_r (errnum, buffer, MaxErrStrLen - 1); + str = strerror_r (errnum, buffer, maxErrStrLen - 1); #else - strerror_r (errnum, buffer, MaxErrStrLen - 1); + strerror_r (errnum, buffer, maxErrStrLen - 1); str = buffer; #endif #elif HAVE_DECL_STRERROR_S // Windows Secure API. - strerror_s (buffer, MaxErrStrLen - 1, errnum); + strerror_s (buffer, maxErrStrLen - 1, errnum); str = buffer; #else // Copy the thread-unsafe result of strerror into the buffer as fast as -- cgit v1.2.3