[libcxx-commits] [libcxx] e1ddc33 - [libc++] Move __libcpp_timespec_t into namespace std (#80004)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 30 10:53:18 PST 2024


Author: Louis Dionne
Date: 2024-01-30T13:53:14-05:00
New Revision: e1ddc3331210957cec2569cef79021fa69363ab1

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

LOG: [libc++] Move __libcpp_timespec_t into namespace std (#80004)

It was previously defined outside of namespace std for apparently no
good reason.

Added: 
    

Modified: 
    libcxx/include/__thread/support.h
    libcxx/include/__thread/support/c11.h
    libcxx/include/__thread/support/pthread.h
    libcxx/include/__thread/support/windows.h

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__thread/support.h b/libcxx/include/__thread/support.h
index 33f343a876dac..92f1c4415e4df 100644
--- a/libcxx/include/__thread/support.h
+++ b/libcxx/include/__thread/support.h
@@ -23,6 +23,8 @@
 // The following functionality must be provided by any implementation:
 //
 
+_LIBCPP_BEGIN_NAMESPACE_STD
+
 using __libcpp_timespec_t = ...;
 
 //
@@ -98,6 +100,8 @@ int __libcpp_tls_create(__libcpp_tls_key*, void (*__at_exit)(void*));
 void* __libcpp_tls_get(__libcpp_tls_key);
 int __libcpp_tls_set(__libcpp_tls_key, void*);
 
+_LIBCPP_END_NAMESPACE_STD
+
 */
 
 #if !defined(_LIBCPP_HAS_NO_THREADS)

diff  --git a/libcxx/include/__thread/support/c11.h b/libcxx/include/__thread/support/c11.h
index 44515454d6958..896264891cc45 100644
--- a/libcxx/include/__thread/support/c11.h
+++ b/libcxx/include/__thread/support/c11.h
@@ -20,10 +20,10 @@
 #  pragma GCC system_header
 #endif
 
-typedef ::timespec __libcpp_timespec_t;
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
+using __libcpp_timespec_t = ::timespec;
+
 //
 // Mutex
 //

diff  --git a/libcxx/include/__thread/support/pthread.h b/libcxx/include/__thread/support/pthread.h
index 6ea2a38f6b6b3..d0b8367e448f4 100644
--- a/libcxx/include/__thread/support/pthread.h
+++ b/libcxx/include/__thread/support/pthread.h
@@ -36,10 +36,10 @@
 #  pragma GCC system_header
 #endif
 
-typedef ::timespec __libcpp_timespec_t;
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
+using __libcpp_timespec_t = ::timespec;
+
 //
 // Mutex
 //

diff  --git a/libcxx/include/__thread/support/windows.h b/libcxx/include/__thread/support/windows.h
index 16d1f3ba5a3cc..5dc4fa14f45b6 100644
--- a/libcxx/include/__thread/support/windows.h
+++ b/libcxx/include/__thread/support/windows.h
@@ -18,10 +18,10 @@
 #  pragma GCC system_header
 #endif
 
-typedef ::timespec __libcpp_timespec_t;
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
+using __libcpp_timespec_t = ::timespec;
+
 //
 // Mutex
 //


        


More information about the libcxx-commits mailing list