[MDEV-15291] OQGraph fails to build on FreeBSD Created: 2018-02-12  Updated: 2018-04-06  Resolved: 2018-04-06

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - OQGRAPH
Affects Version/s: 10.0.34, 10.2.12, 10.1.31, 10.3.5
Fix Version/s: 10.0.35

Type: Bug Priority: Major
Reporter: Bernard Spil Assignee: Sergey Vojtovich
Resolution: Fixed Votes: 0
Labels: contribution, foundation
Environment:

FreeBSD 11.1 amd64
CMake 3.10.2
clang 4.0



 Description   

When building the OQGRAPH engine, it errors out

--- storage/oqgraph/CMakeFiles/oqgraph.dir/graphcore.cc.o ---
In file included from /usr/ports/databases/mariadb100-server/work/mariadb-10.0.34/storage/oqgraph/graphcore.cc:29:
In file included from /usr/ports/databases/mariadb100-server/work/mariadb-10.0.34/storage/oqgraph/graphcore-graph.h:28:
In file included from /usr/ports/databases/mariadb100-server/work/mariadb-10.0.34/storage/oqgraph/oqgraph_shim.h:28:
/usr/ports/databases/mariadb100-server/work/mariadb-10.0.34/storage/oqgraph/oqgraph_judy.h:66:24: error: too few arguments provided
 to function-like macro invocation
        return setbit(n);                                               
                       ^
/usr/include/sys/param.h:285:9: note: macro 'setbit' defined here              
#define setbit(a,i)     (((unsigned char *)(a))[(i)/NBBY] |= 1<<((i)%NBBY))
        ^

Not sure from where OQGraph expects the bitset defined from but this is broken now.



 Comments   
Comment by Bernard Spil [ 2018-02-12 ]

Just checked Ubuntu and there setbit also requires 2 arguments

/usr/include/x86_64-linux-gnu/sys/param.h:#define setbit(a,i)     ((a)[(i)/NBBY] |= 1<<((i)%NBBY))

Comment by Bernard Spil [ 2018-02-13 ]

As both FreeBSD and Linux define setbit(a,i) in sys/param.h it seems sensible to rename the methods in OQGraph Judy to avoid collision.

I've created a pull-request for this (prefixing with j but perhaps prefix Judy, or just _, would make more sense) https://github.com/MariaDB/server/pull/611

Comment by Bernard Spil [ 2018-02-27 ]

Duplicate of MDEV-14590

Generated at Thu Feb 08 08:20:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.