Skip to content

Commit 7df396e

Browse files
authored
apacheGH-46011: [C++] Hide DCHECK family from public headers (apache#46015)
### Rationale for this change `arrow/util/logging.h` exports `DCHECK()` family macros as internal macros. They are conflicted with macros provided by glog when glog headers are included after `arrow/util/logging.h`. ### What changes are included in this PR? * Move `DCHECK()` family macros to `arrow/util/logging_internal.h` * Use `arrow/util/logging_internal.h` not `.../logging.h` in `*.cc` * Use `ARROW_DCHECK*()` macros instead of `DCHECK*()` macros in headers including `*_internal.h` * Use `ARROW_DCHECK*()` macros instead of `DCHECK*()` macros in examples * Use `ARROW_DCHECK*()` macros instead of `DCHECK*()` macros in `python/` ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. * GitHub Issue: apache#46011 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
1 parent 4565b61 commit 7df396e

File tree

322 files changed

+551
-451
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

322 files changed

+551
-451
lines changed

cpp/examples/arrow/rapidjson_row_converter.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ arrow::Result<std::shared_ptr<arrow::RecordBatch>> ConvertToRecordBatch(
516516
ARROW_ASSIGN_OR_RAISE(batch, batch_builder->Flush());
517517

518518
// Use RecordBatch::ValidateFull() to make sure arrays were correctly constructed.
519-
DCHECK_OK(batch->ValidateFull());
519+
ARROW_RETURN_NOT_OK(batch->ValidateFull());
520520
return batch;
521521
} // ConvertToRecordBatch
522522

cpp/examples/parquet/low_level_api/encryption_reader_writer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ int main(int argc, char** argv) {
189189
file_writer->Close();
190190

191191
// Write the bytes to file
192-
DCHECK(out_file->Close().ok());
192+
ARROW_DCHECK(out_file->Close().ok());
193193
} catch (const std::exception& e) {
194194
std::cerr << "Parquet write error: " << e.what() << std::endl;
195195
return -1;

cpp/examples/parquet/low_level_api/encryption_reader_writer_all_crypto_options.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ void InteropTestWriteEncryptedParquetFiles(std::string root_path) {
342342
file_writer->Close();
343343

344344
// Write the bytes to file
345-
DCHECK(out_file->Close().ok());
345+
ARROW_DCHECK(out_file->Close().ok());
346346
} catch (const std::exception& e) {
347347
std::cerr << "Parquet write error: " << e.what() << std::endl;
348348
return;

cpp/examples/parquet/low_level_api/reader_writer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ int main(int argc, char** argv) {
166166
file_writer->Close();
167167

168168
// Write the bytes to file
169-
DCHECK(out_file->Close().ok());
169+
ARROW_DCHECK(out_file->Close().ok());
170170
} catch (const std::exception& e) {
171171
std::cerr << "Parquet write error: " << e.what() << std::endl;
172172
return -1;

cpp/examples/parquet/low_level_api/reader_writer2.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ int main(int argc, char** argv) {
187187
file_writer->Close();
188188

189189
// Write the bytes to file
190-
DCHECK(out_file->Close().ok());
190+
ARROW_DCHECK(out_file->Close().ok());
191191
} catch (const std::exception& e) {
192192
std::cerr << "Parquet write error: " << e.what() << std::endl;
193193
return -1;

cpp/src/arrow/acero/accumulation_queue.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <vector>
2424

2525
#include "arrow/compute/exec.h"
26-
#include "arrow/util/logging.h"
26+
#include "arrow/util/logging_internal.h"
2727

2828
namespace arrow {
2929
namespace acero {

cpp/src/arrow/acero/aggregate_benchmark.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "arrow/util/bit_util.h"
3636
#include "arrow/util/bitmap_reader.h"
3737
#include "arrow/util/byte_size.h"
38+
#include "arrow/util/logging_internal.h"
3839
#include "arrow/util/string.h"
3940

4041
namespace arrow {

cpp/src/arrow/acero/aggregate_internal.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "arrow/datum.h"
3232
#include "arrow/result.h"
3333
#include "arrow/util/checked_cast.h"
34-
#include "arrow/util/logging.h"
34+
#include "arrow/util/logging_internal.h"
3535

3636
namespace arrow {
3737

cpp/src/arrow/acero/asof_join_node.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
#include "arrow/util/checked_cast.h"
5757
#include "arrow/util/config.h"
5858
#include "arrow/util/future.h"
59+
#include "arrow/util/logging_internal.h"
5960
#include "arrow/util/string.h"
6061

6162
namespace arrow {

cpp/src/arrow/acero/asof_join_node_test.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#include "arrow/testing/matchers.h"
4949
#include "arrow/testing/random.h"
5050
#include "arrow/util/checked_cast.h"
51+
#include "arrow/util/logging_internal.h"
5152
#include "arrow/util/thread_pool.h"
5253

5354
#define TRACED_TEST(t_class, t_name, t_body) \

0 commit comments

Comments
 (0)