Skip to content

Commit

Permalink
net-p2p/gtk-gnutella: fix build on powerpc*
Browse files Browse the repository at this point in the history
Rename callframe to fix redefinition:
memusage.c:538:8: error: redefinition of 'callframe'
struct callframe {
       ^
/usr/include/machine/frame.h:88:8: note: previous definition is here
struct callframe {
  • Loading branch information
pkubaj committed Oct 27, 2021
1 parent 5c904df commit 8608e04
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions net-p2p/gtk-gnutella/files/patch-src_lib_memusage.c
@@ -0,0 +1,59 @@
--- src/lib/memusage.c.orig 2021-10-27 02:46:02 UTC
+++ src/lib/memusage.c
@@ -535,25 +535,25 @@ memusage_set_stack_accounting(memusage_t *mu, bool on)
MEMUSAGE_THREAD_UNLOCK(mu);
}

-struct callframe {
+struct callframes {
size_t calls;
const struct stackatom *frame;
const struct memusage_counter *mc;
};

/**
- * qsort() callback for sorting callframe items by decreasing call amount.
+ * qsort() callback for sorting callframes items by decreasing call amount.
*/
static int
callframe_cmp(const void *p1, const void *p2)
{
- const struct callframe *f1 = p1, *f2 = p2;
+ const struct callframes *f1 = p1, *f2 = p2;

return CMP(f2->calls, f1->calls); /* Decreasing order */
}

struct callframe_filler {
- struct callframe *array;
+ struct callframes *array;
size_t capacity;
size_t count;
const memusage_t *mu;
@@ -568,7 +568,7 @@ callframe_filler_add(const void *key, void *value, voi
{
struct callframe_filler *filler = data;
struct memusage_counter *mc = value;
- struct callframe *f;
+ struct callframes *f;

memusage_counter_check(mc);
g_assert(filler->count < filler->capacity);
@@ -648,7 +648,7 @@ memusage_sort_frames(const memusage_t *mu, bool period
static void
memusage_sorted_frame_dump_log(logagent_t *la, const memusage_t *mu,
const char *name, const char *what,
- struct callframe *array, size_t count, hash_table_t *all, size_t recurses)
+ struct callframes *array, size_t count, hash_table_t *all, size_t recurses)
{
size_t i;
const char *event;
@@ -664,7 +664,7 @@ memusage_sorted_frame_dump_log(logagent_t *la, const m
event = (0 == mu->width) ? "size" : "calls";

for (i = 0; i < count; i++) {
- struct callframe *cf = &array[i];
+ struct callframes *cf = &array[i];
struct memusage_counter *mc;
size_t total;

0 comments on commit 8608e04

Please sign in to comment.