Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yarpviz: Support compilation with graphviz >= 9 #3056

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/release/yarp_3_9/yarpviz_graphviz9.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#### `yarpviz`

* Support compilation with Graphviz >= 9.
6 changes: 6 additions & 0 deletions extern/qgv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ if(Graphviz_DEFINITIONS)
target_compile_definitions(YARP_priv_qgvcore PRIVATE ${Graphviz_DEFINITIONS})
endif()

if(Graphviz_VERSION)
if(Graphviz_VERSION VERSION_GREATER_EQUAL 9.0)
target_compile_definitions(YARP_priv_qgvcore PRIVATE GRAPHVIZ_VERSION_GE_9)
endif()
endif()

set_property(TARGET YARP_priv_qgvcore PROPERTY FOLDER "Libraries/External")


Expand Down
2 changes: 2 additions & 0 deletions extern/qgv/qgv/QGVCore/private/QGVCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ class QGVCore
rdr.len = strlen(cp);
rdr.cur = 0;

#ifndef GRAPHVIZ_VERSION_GE_9
disc.mem = &AgMemDisc;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unclear: which are the implications of removing disc.mem? Is it safe?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In graphviz, there is not anymore any support for custom memory allocators, see https://gitlab.com/graphviz/graphviz/-/blob/main/CHANGELOG.md#900-2023-09-11 :

Breaking: The concept of “memory allocator discipline” has been removed,
along with the type Agmemdisc_t and fields Agdisc_t.mem and
Agdstate_t.mem.

The default memory allocators are used by default in graphviz 9.

#endif
disc.id = &AgIdDisc;
disc.io = &memIoDisc;
g = agread (&rdr, &disc);
Expand Down
Loading