Skip to content

[libc++] Move __libcpp_timespec_t into namespace std #80004

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Jan 30, 2024

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

It was previously defined outside of namespace std for apparently no
good reason.
@ldionne ldionne requested a review from a team as a code owner January 30, 2024 13:38
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jan 30, 2024
@llvmbot
Copy link
Member

llvmbot commented Jan 30, 2024

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

Changes

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


Full diff: https://github.com/llvm/llvm-project/pull/80004.diff

4 Files Affected:

  • (modified) libcxx/include/__thread/support.h (+4)
  • (modified) libcxx/include/__thread/support/c11.h (+2-2)
  • (modified) libcxx/include/__thread/support/pthread.h (+2-2)
  • (modified) libcxx/include/__thread/support/windows.h (+2-2)
diff --git a/libcxx/include/__thread/support.h b/libcxx/include/__thread/support.h
index 33f343a876da..92f1c4415e4d 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 44515454d695..896264891cc4 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 6ea2a38f6b6b..d0b8367e448f 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 16d1f3ba5a3c..5dc4fa14f45b 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
 //

@ldionne ldionne merged commit e1ddc33 into llvm:main Jan 30, 2024
@ldionne ldionne deleted the review/rename-__libcpp_timespec_t branch January 30, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants