]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: fix possible undefined std::timespec in module std
authoryxj-github-437 <2457369732@qq.com>
Thu, 16 Jan 2025 16:01:01 +0000 (00:01 +0800)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 5 Mar 2025 22:10:26 +0000 (22:10 +0000)
I notice std::timespec and std::timespec_get are used in preprocessor
condition _GLIBCXX_HAVE_TIMESPEC_GET. So in module std, it should be
the same.

libstdc++-v3:

* src/c++23/std-clib.cc.in (timespec): Move within preprocessor
group guarded by _GLIBCXX_HAVE_TIMESPEC_GET.

libstdc++-v3/src/c++23/std-clib.cc.in

index 6809ad229d7c721f45a44779f55e8dbd1cfbeef7..10fc03e7ce0bf88a5c8ce3652fdb9fa67948c8c6 100644 (file)
@@ -585,9 +585,9 @@ export C_LIB_NAMESPACE
   using std::strftime;
   using std::time;
   using std::time_t;
-  using std::timespec;
   using std::tm;
 #ifdef _GLIBCXX_HAVE_TIMESPEC_GET
+  using std::timespec;
   using std::timespec_get;
 #endif
 }