Commit f8fda36
committed
Fix BLOCK_SIZE macro conflict with system headers
When including system headers like <linux/fs.h> which define BLOCK_SIZE
as a macro (usually 1024), it conflicts with the BLOCK_SIZE constant in
concurrentqueue. This causes compilation errors.
Add push/pop macro guards around the entire file to temporarily undefine
BLOCK_SIZE if it exists, and restore it after.
This is a common issue when using concurrentqueue with io_uring or other
Linux headers that define BLOCK_SIZE. The fix uses #pragma push_macro/
pop_macro which is supported by GCC, Clang, and MSVC.1 parent 593df78 commit f8fda36
2 files changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
10 | 17 | | |
11 | 18 | | |
12 | 19 | | |
| |||
580 | 587 | | |
581 | 588 | | |
582 | 589 | | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
53 | 60 | | |
54 | 61 | | |
55 | 62 | | |
| |||
3738 | 3745 | | |
3739 | 3746 | | |
3740 | 3747 | | |
| 3748 | + | |
| 3749 | + | |
| 3750 | + | |
| 3751 | + | |
| 3752 | + | |
| 3753 | + | |
3741 | 3754 | | |
3742 | 3755 | | |
3743 | 3756 | | |
| |||
0 commit comments