You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@arrow.apache.org by "dennis lucero (JIRA)" <ji...@apache.org> on 2018/04/04 18:29:00 UTC

[jira] [Created] (ARROW-2393) [C++] arrow/status.h does not define ARROW_CHECK needed for ARROW_CHECK_OK

dennis lucero created ARROW-2393:
------------------------------------

             Summary: [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


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)