LIST_MOVE collision with alpine linux bsd headers
eugpermar opened this issue · comments
Eugenio Pérez commented
I'm trying to use librd in alpine linux. However, it bsd-tools package already have a LIST_MOVE macro define in it's package bsd-compat-headers
.
It could be fixed easily with an ifdef, but alpine LIST_MOVE
has a different (simpler) macro arguments:
#define LIST_MOVE(head1, head2) do { \
LIST_INIT((head2)); \
if (!LIST_EMPTY((head1))) { \
(head2)->lh_first = (head1)->lh_first; \
LIST_INIT((head1)); \
} \
} while (/*CONSTCOND*/0)
So the solutions could be:
- (I think that) no one has tried this before, so librd could just override LIST_MOVE. Future projects that include librd and uses alpine-like LIST_MOVE will break
- Move to alpine-like definition, so anyone that uses librd LIST_MOVE break.
I personally prefer option 2, but probably you will like to maintain retro-compatibility. It you choose the option, I can send you the PR.
Magnus Edenhill commented
I vote for option 2 (which is what librdkafka has already done).
Eugenio Pérez commented
Done then. Thanks!