cameron314 / concurrentqueue

A fast multi-producer, multi-consumer lock-free concurrent queue for C++11
Other
9.53k stars 1.66k forks source link

Replace BLOCK_SIZE with CQ_BLOCK_SIZE #312

Closed jcelerier closed 1 year ago

jcelerier commented 1 year ago

As Linux defines as a C macro it in <sys/mount.h>.

So, as much as I think that Linux shouldn't define such generic-sounding macro... I don't think it'd be an easy change to get accepted upstream, but it leads to errors if for some reason <sys/mount.h> gets included before concurrentqueue, thus it's likely safer to prefix the variable name here. CQ_BLOCK_SIZE yields no matches in my /usr/include so less likely to conflict

cameron314 commented 1 year ago

Ugh, that's annoying!

I can't change this without breaking the API. Can you not include <sys/mount.h> after concurrentqueue.h? Or undef the macro?

cameron314 commented 1 year ago

As I said, this breaks the public API, so I can't merge this as-is, sorry.

jcelerier commented 1 year ago

wops sorry, I'm just updating my personal fork and this pushes notifications here for some reason (both options you proposed I cannot do easily sadly :/)