[ 
https://issues.apache.org/jira/browse/ARROW-2393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16439950#comment-16439950
 ] 

Joshua Storck commented on ARROW-2393:
--------------------------------------

I don't think the ARROW_CHECK_OK and ARROW_CHECK_OK_PREPEND macros should be in 
status.h. They use the logging facilities and should probably be in logging.h, 
which shouldn't be visible.

The interesting thing is that the RETURN_NOT_OK macros don't work outside of 
the arrow namespace. I think they need to be updated to use ::arrow::Status in 
their bodies.

[~wesmckinn], [~pitrou], or [~cpcloud], does that make sense? If so, I'll 
submit a PR.

> [C++] arrow/status.h does not define ARROW_CHECK needed for ARROW_CHECK_OK
> --------------------------------------------------------------------------
>
>                 Key: ARROW-2393
>                 URL: https://issues.apache.org/jira/browse/ARROW-2393
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++
>    Affects Versions: 0.9.0
>            Reporter: dennis lucero
>            Priority: Trivial
>
> test.cpp
> {code:c++}
> #include <arrow/api.h>
> int main(void) {
> arrow::Int64Builder i64builder;
> std::shared_ptr<arrow::Array> i64array;
> ARROW_CHECK_OK(i64builder.Finish(&i64array));
> return EXIT_SUCCESS;
> }
> {code}
> Attempt to build:
> {code:bash}
> $CXX test.cpp -std=c++11 -larrow
> {code}
> Error:
> {code}
> test.cpp:6:2: error: use of undeclared identifier 'ARROW_CHECK' 
> ARROW_CHECK_OK(i64builder.Finish(&i64array)); ^ 
> xxx/include/arrow/status.h:49:27: note: expanded from macro 'ARROW_CHECK_OK' 
> #define ARROW_CHECK_OK(s) ARROW_CHECK_OK_PREPEND(s, "Bad status") ^ 
> xxx/include/arrow/status.h:44:5: note: expanded from macro 
> 'ARROW_CHECK_OK_PREPEND' ARROW_CHECK(_s.ok()) << (msg) << ": " << 
> _s.ToString(); \ ^ 1 error generated.
> {code}
> I expect that ARROW_* macro are public API, and should work out of the box.
> A naive attempt to fix it
> {code}
> diff --git a/cpp/src/arrow/status.h b/cpp/src/arrow/status.h
> index 84f55e41..6da4a773 100644
> --- a/cpp/src/arrow/status.h
> +++ b/cpp/src/arrow/status.h
> @@ -25,6 +25,7 @@
>  #include "arrow/util/macros.h"
>  #include "arrow/util/visibility.h"
> +#include "arrow/util/logging.h"
>  // Return the given status if it is not OK.
>  #define ARROW_RETURN_NOT_OK(s)           \
> {code}
> fails with
> {code}
> public-api-test.cc:21:2: error: "DCHECK should not be visible from Arrow 
> public headers."
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to