Kaydet (Commit) a504e7f2 authored tarafından Michael Stahl's avatar Michael Stahl

unordf: put in a version check for librdf_stream_get_context2

Strangely Apple llvm-g++ 4.2.1 ignores the warning-disabling macro here
and gives a deprecation warning, so use a version check instead.

Change-Id: Ibc09930a907baea8665828529332d40de156b70e
üst 15f4c47f
...@@ -454,10 +454,12 @@ librdf_node* librdf_GraphResult::getContext() const ...@@ -454,10 +454,12 @@ librdf_node* librdf_GraphResult::getContext() const
{ {
if (!m_pStream.get() || librdf_stream_end(m_pStream.get())) if (!m_pStream.get() || librdf_stream_end(m_pStream.get()))
return NULL; return NULL;
SAL_WNODEPRECATED_DECLARATIONS_PUSH;
librdf_node *pCtxt( static_cast<librdf_node *> librdf_node *pCtxt( static_cast<librdf_node *>
#if LIBRDF_VERSION >= 10012
(librdf_stream_get_context2(m_pStream.get())) );
#else
(librdf_stream_get_context(m_pStream.get())) ); (librdf_stream_get_context(m_pStream.get())) );
SAL_WNODEPRECATED_DECLARATIONS_POP; #endif
if (pCtxt) if (pCtxt)
return pCtxt; return pCtxt;
return m_pContext.get(); return m_pContext.get();
...@@ -1585,10 +1587,12 @@ librdf_statement *rdfa_context_stream_map_handler( ...@@ -1585,10 +1587,12 @@ librdf_statement *rdfa_context_stream_map_handler(
{ {
OSL_ENSURE(i_pStream, "rdfa_context_stream_map_handler: stream null"); OSL_ENSURE(i_pStream, "rdfa_context_stream_map_handler: stream null");
if (i_pStream) { if (i_pStream) {
SAL_WNODEPRECATED_DECLARATIONS_PUSH;
librdf_node *pCtxt( static_cast<librdf_node *> librdf_node *pCtxt( static_cast<librdf_node *>
#if LIBRDF_VERSION >= 10012
(librdf_stream_get_context2(i_pStream)) );
#else
(librdf_stream_get_context(i_pStream)) ); (librdf_stream_get_context(i_pStream)) );
SAL_WNODEPRECATED_DECLARATIONS_POP; #endif
OSL_ENSURE(pCtxt, "rdfa_context_stream_map_handler: context null"); OSL_ENSURE(pCtxt, "rdfa_context_stream_map_handler: context null");
if (pCtxt && isInternalContext(pCtxt)) { if (pCtxt && isInternalContext(pCtxt)) {
return i_pStatement; return i_pStatement;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment