[libc-commits] [libc] cd45bb2 - [libc][errno] Remove unnecessary include (#92063)

via libc-commits libc-commits at lists.llvm.org
Mon May 13 21:58:17 PDT 2024


Author: Robin Caloudis
Date: 2024-05-14T00:58:13-04:00
New Revision: cd45bb2e435b8e648ac528ed5f5fc1dc2bba48fe

URL: https://github.com/llvm/llvm-project/commit/cd45bb2e435b8e648ac528ed5f5fc1dc2bba48fe
DIFF: https://github.com/llvm/llvm-project/commit/cd45bb2e435b8e648ac528ed5f5fc1dc2bba48fe.diff

LOG: [libc][errno] Remove unnecessary include (#92063)

Since https://github.com/llvm/llvm-project/pull/91150, a proxy header
for the errno macros is available and gets included in `libc_errno.h`
since then.

As `libc_errno.cpp` includes `libc_errno.h`, which already includes the
proxy header `hdr/errno_macros.h`, there's no need to include it in
`libc_errno.cpp` if we are in overlay mode, because the proxy header
takes care to either include our header from libc/include/ (fullbuild)
or the corresponding underlying system header (overlay).

Added: 
    

Modified: 
    libc/src/errno/libc_errno.cpp

Removed: 
    


################################################################################
diff  --git a/libc/src/errno/libc_errno.cpp b/libc/src/errno/libc_errno.cpp
index a59e6c34029d7..64f9f522ca296 100644
--- a/libc/src/errno/libc_errno.cpp
+++ b/libc/src/errno/libc_errno.cpp
@@ -36,9 +36,6 @@ void LIBC_NAMESPACE::Errno::operator=(int a) { __llvmlibc_errno = a; }
 LIBC_NAMESPACE::Errno::operator int() { return __llvmlibc_errno; }
 
 #else
-// In overlay mode, we simply use the system errno.
-#include "hdr/errno_macros.h"
-
 void LIBC_NAMESPACE::Errno::operator=(int a) { errno = a; }
 LIBC_NAMESPACE::Errno::operator int() { return errno; }
 


        


More information about the libc-commits mailing list