Skip to content

Commit 79ac120

Browse files
committed
Revert to NDEBUG because it's a standard define in release builds in MSVC
Change-Id: Ia4031fd71ff615c16f4d2e07675727385e28e82f
1 parent ae6bc9f commit 79ac120

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

cpp/cmake_modules/SetupCxxFlags.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ endif()
8080
if (NOT MSVC)
8181
set(CXX_FLAGS_DEBUG "-ggdb -O0")
8282
set(CXX_FLAGS_FASTDEBUG "-ggdb -O1")
83-
set(CXX_FLAGS_RELEASE "-O3 -DARROW_NDEBUG")
83+
set(CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
8484
endif()
8585

8686
set(CXX_FLAGS_PROFILE_GEN "${CXX_FLAGS_RELEASE} -fprofile-generate")

cpp/src/arrow/allocator-test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ TEST(stl_allocator, FreeLargeMemory) {
4646

4747
uint8_t* data = alloc.allocate(100);
4848

49-
#ifndef ARROW_NDEBUG
49+
#ifndef NDEBUG
5050
EXPECT_EXIT(alloc.deallocate(data, 120), ::testing::ExitedWithCode(1),
5151
".*Check failed: \\(bytes_allocated_\\) >= \\(size\\)");
5252
#endif

cpp/src/arrow/ipc/metadata.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ Status WriteFileFooter(const Schema& schema, const std::vector<FileBlock>& dicti
774774
flatbuffers::Offset<flatbuf::Schema> fb_schema;
775775
RETURN_NOT_OK(SchemaToFlatbuffer(fbb, schema, dictionary_memo, &fb_schema));
776776

777-
#ifndef ARROW_NDEBUG
777+
#ifndef NDEBUG
778778
for (size_t i = 0; i < dictionaries.size(); ++i) {
779779
DCHECK(BitUtil::IsMultipleOf8(dictionaries[i].offset)) << i;
780780
DCHECK(BitUtil::IsMultipleOf8(dictionaries[i].metadata_length)) << i;

cpp/src/arrow/ipc/writer.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class RecordBatchSerializer : public ArrayVisitor {
188188
int64_t* body_length) {
189189
RETURN_NOT_OK(Assemble(batch, body_length));
190190

191-
#ifndef ARROW_NDEBUG
191+
#ifndef NDEBUG
192192
int64_t start_position, current_position;
193193
RETURN_NOT_OK(dst->Tell(&start_position));
194194
#endif
@@ -202,7 +202,7 @@ class RecordBatchSerializer : public ArrayVisitor {
202202
RETURN_NOT_OK(WriteMetadataMessage(batch.num_rows(), *body_length, &metadata_fb));
203203
RETURN_NOT_OK(WriteMessage(*metadata_fb, dst, metadata_length));
204204

205-
#ifndef ARROW_NDEBUG
205+
#ifndef NDEBUG
206206
RETURN_NOT_OK(dst->Tell(&current_position));
207207
DCHECK(BitUtil::IsMultipleOf8(current_position));
208208
#endif
@@ -228,7 +228,7 @@ class RecordBatchSerializer : public ArrayVisitor {
228228
}
229229
}
230230

231-
#ifndef ARROW_NDEBUG
231+
#ifndef NDEBUG
232232
RETURN_NOT_OK(dst->Tell(&current_position));
233233
DCHECK(BitUtil::IsMultipleOf8(current_position));
234234
#endif

cpp/src/arrow/memory_pool-test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ TEST(DefaultMemoryPoolDeathTest, FreeLargeMemory) {
4747
uint8_t* data;
4848
ASSERT_OK(pool->Allocate(100, &data));
4949

50-
#ifndef ARROW_NDEBUG
50+
#ifndef NDEBUG
5151
EXPECT_EXIT(pool->Free(data, 120), ::testing::ExitedWithCode(1),
5252
".*Check failed: \\(bytes_allocated_\\) >= \\(size\\)");
5353
#endif

cpp/src/arrow/table-test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ TEST_F(TestRecordBatch, Equals) {
459459
ASSERT_FALSE(b1.Equals(b4));
460460
}
461461

462-
#ifdef ARROW_NDEBUG
462+
#ifdef NDEBUG
463463
// In debug builds, RecordBatch ctor aborts if you construct an invalid one
464464

465465
TEST_F(TestRecordBatch, Validate) {

cpp/src/arrow/util/logging.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ namespace arrow {
4747
: ::arrow::internal::FatalLog(ARROW_FATAL) \
4848
<< __FILE__ << __LINE__ << " Check failed: " #condition " "
4949

50-
#ifdef ARROW_NDEBUG
50+
#ifdef NDEBUG
5151
#define ARROW_DFATAL ARROW_WARNING
5252

5353
#define DCHECK(condition) \
@@ -83,7 +83,7 @@ namespace arrow {
8383
#define DCHECK_GE(val1, val2) ARROW_CHECK((val1) >= (val2))
8484
#define DCHECK_GT(val1, val2) ARROW_CHECK((val1) > (val2))
8585

86-
#endif // ARROW_NDEBUG
86+
#endif // NDEBUG
8787

8888
namespace internal {
8989

0 commit comments

Comments
 (0)