summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliuyu <[email protected]>2024-06-28 02:20:05 -0400
committerliuyu <[email protected]>2024-06-28 02:20:05 -0400
commit7fcf59a3cdcbb98fd8a7352a2f1b6e051c2d371a (patch)
treeb642f5e0e5b1254c64325f8eade2a1e0d3c8b262
parent94ed0354d88eb3d51c5bf4333eeb3a1474c350d2 (diff)
cmake添加 D_GNU_SOURCE
-rw-r--r--bbq/CMakeLists.txt1
-rw-r--r--bbq/tests/common/test_mix.c6
-rw-r--r--perf/CMakeLists.txt1
3 files changed, 4 insertions, 4 deletions
diff --git a/bbq/CMakeLists.txt b/bbq/CMakeLists.txt
index 1242a45..e8f8a9b 100644
--- a/bbq/CMakeLists.txt
+++ b/bbq/CMakeLists.txt
@@ -22,6 +22,7 @@ add_compile_options(-Wall -Wextra)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DBBQ_MEMORY)
endif()
+add_definitions(-D_GNU_SOURCE)
# 库生成的路径
set(LIB_PATH ${OUTPUT_DIR}/lib)
diff --git a/bbq/tests/common/test_mix.c b/bbq/tests/common/test_mix.c
index 28468f1..713dc99 100644
--- a/bbq/tests/common/test_mix.c
+++ b/bbq/tests/common/test_mix.c
@@ -1,9 +1,8 @@
/*
* @Description: 描述信息
* @Date: 2024-05-25 10:55:48
- * @LastEditTime: 2024-06-17 17:14:16
+ * @LastEditTime: 2024-06-27 23:39:44
*/
-#define _GNU_SOURCE
#include "test_mix.h"
#include "bbq.h"
#include <pthread.h>
@@ -157,11 +156,10 @@ char *test_ring_type_enum2str(test_ring_type ring_type) {
int test_setaffinity(int core_id) {
cpu_set_t mask;
CPU_ZERO(&mask);
-
CPU_SET(core_id, &mask);
if (pthread_setaffinity_np(pthread_self(), sizeof(mask), &mask) == -1) {
- fprintf(stderr, "pthread_setaffinity_np erro\n");
+ TEST_ERR_LOG("pthread_setaffinity_np erro\n");
return BBQ_ERR;
}
diff --git a/perf/CMakeLists.txt b/perf/CMakeLists.txt
index 40e8326..1abb654 100644
--- a/perf/CMakeLists.txt
+++ b/perf/CMakeLists.txt
@@ -24,6 +24,7 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif()
+add_definitions(-D_GNU_SOURCE)
add_compile_options(-Wall -Wextra)
# 库生成的路径