[libc-commits] [libc] [libc][NFC] Fix extraneous namespace on Errno (PR #80894)

via libc-commits libc-commits at lists.llvm.org
Tue Feb 6 10:41:35 PST 2024


https://github.com/michaelrj-google created https://github.com/llvm/llvm-project/pull/80894

The Errno type doesn't need to be explicitly namespaced now that it's
enclosed in a namespace.


>From 2725669642536eb4d2fc787ad131816a7e47b8b4 Mon Sep 17 00:00:00 2001
From: Michael Jones <michaelrj at google.com>
Date: Tue, 6 Feb 2024 10:40:16 -0800
Subject: [PATCH] [libc][NFC] Fix extraneous namespace on Errno

The Errno type doesn't need to be explicitly namespaced now that it's
enclosed in a namespace.
---
 libc/src/errno/libc_errno.cpp | 2 +-
 libc/src/errno/libc_errno.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libc/src/errno/libc_errno.cpp b/libc/src/errno/libc_errno.cpp
index 4af21dccc1564c..30b0a67a3241d8 100644
--- a/libc/src/errno/libc_errno.cpp
+++ b/libc/src/errno/libc_errno.cpp
@@ -46,5 +46,5 @@ LIBC_NAMESPACE::Errno::operator int() { return errno; }
 
 namespace LIBC_NAMESPACE {
 // Define the global `libc_errno` instance.
-LIBC_NAMESPACE::Errno libc_errno;
+Errno libc_errno;
 } // namespace LIBC_NAMESPACE
diff --git a/libc/src/errno/libc_errno.h b/libc/src/errno/libc_errno.h
index 6a6ddbc3a9c057..5afc0a41d348ae 100644
--- a/libc/src/errno/libc_errno.h
+++ b/libc/src/errno/libc_errno.h
@@ -40,7 +40,7 @@ struct Errno {
   operator int();
 };
 
-extern LIBC_NAMESPACE::Errno libc_errno;
+extern Errno libc_errno;
 
 } // namespace LIBC_NAMESPACE
 



More information about the libc-commits mailing list