Skip to content

Commit c24e641

Browse files
authored
Fix UT compilation errors with GCC 13 due to missing <cstdint> includes (#2979)
GCC 13 no longer transitively includes <cstdint> from other standard library headers. This causes compilation failures for code using types like uint32_t and uintptr_t without explicitly including <cstdint>. This commit adds the missing #include <cstdint> 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
1 parent 66e9635 commit c24e641

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/bthread/list_of_abafree_id.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#include <deque>
2626
#include <vector>
27-
27+
#include <cstdint>
2828
#include "butil/macros.h"
2929

3030
namespace bthread {

test/baidu_thread_local_unittest.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include <gtest/gtest.h>
1919
#include <errno.h>
20+
#include <cstdint>
2021
#include "butil/thread_local.h"
2122

2223
namespace {

0 commit comments

Comments
 (0)