Skip to content

Commit 6552b86

Browse files
committed
Fix kafka compiling problem.
1 parent a9121bb commit 6552b86

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ cc_library(
212212
srcs = [
213213
'src/factory/KafkaTaskImpl.cc',
214214
'src/protocol/KafkaMessage.cc',
215+
'src/protocol/KafkaResult.cc',
215216
],
216217
copts = ['-fno-rtti'],
217218
deps = [
@@ -237,7 +238,6 @@ cc_library(
237238
srcs = [
238239
'src/client/WFKafkaClient.cc',
239240
'src/protocol/KafkaDataTypes.cc',
240-
'src/protocol/KafkaResult.cc',
241241
'src/protocol/kafka_parser.c',
242242
],
243243
deps = [

src/protocol/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,5 @@ if (KAFKA STREQUAL "y")
4444
)
4545
add_library("protocol_kafka" OBJECT ${SRC})
4646
set_property(SOURCE KafkaMessage.cc APPEND PROPERTY COMPILE_OPTIONS "-fno-rtti")
47+
set_property(SOURCE KafkaResult.cc APPEND PROPERTY COMPILE_OPTIONS "-fno-rtti")
4748
endif ()

src/protocol/KafkaMessage.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,13 +377,11 @@ static int compress_buf(KafkaBlock *block, int compress_type, void *env)
377377
}
378378

379379
*block = std::move(nblock);
380-
381380
break;
382381

383382
case Kafka_Snappy:
384383
snappy_buffer = static_cast<KafkaBuffer *>(env);
385384
snappy_buffer->append((const char *)block->get_block(), block->get_len());
386-
387385
break;
388386

389387
case Kafka_Lz4:

src/protocol/KafkaResult.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ KafkaResult::KafkaResult()
3333
this->resp_num = 0;
3434
}
3535

36+
KafkaResult::~KafkaResult()
37+
{
38+
delete []this->resp_vec;
39+
}
40+
3641
KafkaResult& KafkaResult::operator= (KafkaResult&& move)
3742
{
3843
if (this != &move)

src/protocol/KafkaResult.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ class KafkaResult
4545
public:
4646
KafkaResult();
4747

48-
virtual ~KafkaResult()
49-
{
50-
delete []this->resp_vec;
51-
}
48+
virtual ~KafkaResult();
5249

5350
KafkaResult& operator= (KafkaResult&& move);
5451

src/protocol/xmake.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ target("protocol")
3838

3939
target("kafka_message")
4040
if has_config("kafka") then
41-
add_files("KafkaMessage.cc")
41+
add_files("KafkaMessage.cc",
42+
"KafkaResult.cc")
4243
set_kind("object")
4344
add_cxxflags("-fno-rtti")
4445
add_packages("lz4", "zstd", "zlib", "snappy")
@@ -50,8 +51,7 @@ target("kafka_protocol")
5051
if has_config("kafka") then
5152
set_kind("object")
5253
add_files("kafka_parser.c",
53-
"KafkaDataTypes.cc",
54-
"KafkaResult.cc")
54+
"KafkaDataTypes.cc")
5555
add_deps("kafka_message", "protocol")
5656
add_packages("zlib", "snappy", "zstd", "lz4")
5757
else

0 commit comments

Comments
 (0)