Skip to content

Commit

Permalink
[libc][errno] Remove unnecessary include (#92063)
Browse files Browse the repository at this point in the history
Since #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).
  • Loading branch information
robincaloudis committed May 14, 2024
1 parent 364f988 commit cd45bb2
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions libc/src/errno/libc_errno.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down

0 comments on commit cd45bb2

Please sign in to comment.