aboutsummaryrefslogtreecommitdiff
path: root/rcc
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-10-22 20:16:11 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-10-22 20:16:11 +0800
commit04381920b62d63b98730dfe3cb4d87771664350f (patch)
tree4eb1069acd03043d6c08b6fc56d94cf8bf50775f /rcc
parent98b8218afdb00497a0d4373a6023e04686d1e559 (diff)
downloadrcc-project-04381920b62d63b98730dfe3cb4d87771664350f.tar.gz
rcc-project-04381920b62d63b98730dfe3cb4d87771664350f.tar.xz
[Support] Add RCCSupport target and naming rules
Diffstat (limited to 'rcc')
-rw-r--r--rcc/lib/CMakeLists.txt5
-rw-r--r--rcc/lib/Support/Errno.cc10
2 files changed, 9 insertions, 6 deletions
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