Skip to content

Commit

Permalink
dev-libs/ucommon: Fix building with GCC-7 and GCC8
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Levine <plevine457@gmail.com>
Closes: https://bugs.gentoo.org/638252
Closes: #9994
Package-Manager: Portage-2.3.49, Repoman-2.3.10
  • Loading branch information
Peter-Levine committed Sep 28, 2018
1 parent 01c3c1a commit 9819c9c
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
53 changes: 53 additions & 0 deletions dev-libs/ucommon/files/ucommon-6.5.7-gcc7.patch
@@ -0,0 +1,53 @@
Bug: https://bugs.gentoo.org/638252

--- a/inc/ucommon/linked.h
+++ b/inc/ucommon/linked.h
@@ -1992,7 +1992,7 @@
* @return pointer to index root.
*/
inline NamedObject **root(void) {
- return static_cast<NamedObject**>(&head);
+ return reinterpret_cast<NamedObject**>(&head);
}

/**
--- a/inc/ucommon/memory.h
+++ b/inc/ucommon/memory.h
@@ -1228,7 +1228,7 @@
* inherit keyassoc privately.
* @return pager utilization, 0-100.
*/
- inline unsigned utilization(void) const
+ inline unsigned utilization(void)
{return mempager::utilization();}

/**
@@ -1322,7 +1322,7 @@
* inherit keyassoc privately.
* @return pager utilization, 0-100.
*/
- inline unsigned utilization(void) const
+ inline unsigned utilization(void)
{return mempager::utilization();}

/**
@@ -1396,7 +1396,7 @@
* @param name to search for.
* @return typed object if found through map or NULL.
*/
- inline T *get(const char *name) const {
+ inline T *get(const char *name) {
T *node = (static_cast<T*>(NamedObject::map(idx, name, M)));
if(!node) {
node = init<T>(static_cast<T*>(mempager::_alloc(sizeof(T))));
--- a/inc/ucommon/object.h
+++ b/inc/ucommon/object.h
@@ -301,7 +301,7 @@
return reference_cast<T>(get(offset));
}

- inline const T* at(unsigned offset) const {
+ inline const T* at(unsigned offset) {
return immutable_cast<T*>(SparseObjects::get(offset));
}

1 change: 1 addition & 0 deletions dev-libs/ucommon/ucommon-6.5.7.ebuild
Expand Up @@ -36,6 +36,7 @@ DOCS=(README NEWS SUPPORT ChangeLog AUTHORS)
PATCHES=(
"${FILESDIR}/${PN}-6.0.3-install_gcrypt.m4_file.patch"
"${FILESDIR}/${PN}-6.3.1-gcrypt_autotools.patch"
"${FILESDIR}/${PN}-6.5.7-gcc7.patch"
)

# Needed for doxygen, bug #526726
Expand Down

0 comments on commit 9819c9c

Please sign in to comment.