biology/libbigwig: Fix name-clashing in roundup

Rename the roundup method defined in bwValues.c as it clashes with the
roundup macro defined in sys/param.h

/wrkdirs/usr/ports/biology/libbigwig/work/libBigWig-0.4.7/bwValues.c:9:35:
error: too few arguments provided to function-like macro invocation
static uint32_t roundup(uint32_t v) {
                                  ^
/usr/include/sys/param.h:300:9: note: macro 'roundup' defined here
        ^
/wrkdirs/usr/ports/biology/libbigwig/work/libBigWig-0.4.7/bwValues.c:9:24:
error: expected ';' after top level declarator
static uint32_t roundup(uint32_t v) {
                       ^
                       ;
/wrkdirs/usr/ports/biology/libbigwig/work/libBigWig-0.4.7/bwValues.c:350:30:
error: too few arguments provided to function-like macro invocation
        o->m = roundup(o->l+1);
                             ^
/usr/include/sys/param.h:300:9: note: macro 'roundup' defined here
        ^
/wrkdirs/usr/ports/biology/libbigwig/work/libBigWig-0.4.7/bwValues.c:370:30:
error: too few arguments provided to function-like macro invocation
        o->m = roundup(o->l+1);
                             ^
/usr/include/sys/param.h:300:9: note: macro 'roundup' defined here
        ^
4 errors generated.

Approved by:	portmgr (blanket)
This commit is contained in:
Jason E. Hale 2023-12-28 16:29:57 -05:00
parent 09d15f9a61
commit 0843a53a96
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,29 @@
--- bwValues.c.orig 2023-12-28 21:21:29 UTC
+++ bwValues.c
@@ -6,7 +6,7 @@
#include <zlib.h>
#include <errno.h>
-static uint32_t roundup(uint32_t v) {
+static uint32_t bwRoundup(uint32_t v) {
v--;
v |= v >> 1;
v |= v >> 2;
@@ -347,7 +347,7 @@ static bwOverlappingIntervals_t *pushIntervals(bwOverl
//Returns NULL on error, in which case o has been free()d
static bwOverlappingIntervals_t *pushIntervals(bwOverlappingIntervals_t *o, uint32_t start, uint32_t end, float value) {
if(o->l+1 >= o->m) {
- o->m = roundup(o->l+1);
+ o->m = bwRoundup(o->l+1);
o->start = realloc(o->start, o->m * sizeof(uint32_t));
if(!o->start) goto error;
o->end = realloc(o->end, o->m * sizeof(uint32_t));
@@ -367,7 +367,7 @@ static bbOverlappingEntries_t *pushBBIntervals(bbOverl
static bbOverlappingEntries_t *pushBBIntervals(bbOverlappingEntries_t *o, uint32_t start, uint32_t end, char *str, int withString) {
if(o->l+1 >= o->m) {
- o->m = roundup(o->l+1);
+ o->m = bwRoundup(o->l+1);
o->start = realloc(o->start, o->m * sizeof(uint32_t));
if(!o->start) goto error;
o->end = realloc(o->end, o->m * sizeof(uint32_t));