concurrentqueue icon indicating copy to clipboard operation
concurrentqueue copied to clipboard

BLOCK_SIZE defined by linux/fs.h

Open dvd0101 opened this issue 3 years ago • 0 comments

Hi,

concurrentqueue does not compile if included after <linux/fs.h> because the latter defines BLOCK_SIZE :(

example:

$ echo '
#include <linux/fs.h>
#include "concurrentqueue.h"
int main() {}' | g++ -x c++ -

In file included from <stdin>:2:
concurrentqueue.h:342:29: error: expected unqualified-id before numeric constant
  342 |         static const size_t BLOCK_SIZE = 32;
      |                             ^~~~~~~~~~
concurrentqueue.h:342:29: error: expected ‘)’ before numeric constant
  342 |         static const size_t BLOCK_SIZE = 32;
      |                             ^~~~~~~~~~
concurrentqueue.h:762:29: error: expected unqualified-id before numeric constant
  762 |         static const size_t BLOCK_SIZE = static_cast<size_t>(Traits::BLOCK_SIZE);
      |                             ^~~~~~~~~~
concurrentqueue.h:762:29: error: expected ‘)’ before numeric constant
  762 |         static const size_t BLOCK_SIZE = static_cast<size_t>(Traits::BLOCK_SIZE);
      |                             ^~~~~~~~~~

dvd0101 avatar Jan 31 '22 23:01 dvd0101