From d0f94f2442e922fe062571ed41b69371d931582a Mon Sep 17 00:00:00 2001 From: yexiaochuan Date: Sun, 1 Jun 2025 16:14:51 +0800 Subject: [PATCH] Fix UT compilation errors with GCC 13 due to missing includes GCC 13 no longer transitively includes from other standard library headers. This causes compilation failures for code using types like uint32_t and uintptr_t without explicitly including . This commit adds the missing #include directives to: - test/baidu_thread_local_unittest.cpp - src/bthread/list_of_abafree_id.h The errors were: - error: 'uintptr_t' was not declared in this scope - error: 'uint32_t' does not name a type This change ensures compatibility with GCC 13 while maintaining backward compatibility with older compiler versions. Reference: https://gcc.gnu.org/gcc-13/porting_to.html --- src/bthread/list_of_abafree_id.h | 2 +- test/baidu_thread_local_unittest.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bthread/list_of_abafree_id.h b/src/bthread/list_of_abafree_id.h index 45043acc5b..16de5b2009 100644 --- a/src/bthread/list_of_abafree_id.h +++ b/src/bthread/list_of_abafree_id.h @@ -24,7 +24,7 @@ #include #include - +#include #include "butil/macros.h" namespace bthread { diff --git a/test/baidu_thread_local_unittest.cpp b/test/baidu_thread_local_unittest.cpp index 01209b6b78..4cc629f3e8 100644 --- a/test/baidu_thread_local_unittest.cpp +++ b/test/baidu_thread_local_unittest.cpp @@ -17,6 +17,7 @@ #include #include +#include #include "butil/thread_local.h" namespace {