1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| git show e709e55
commit e709e5589dcef5a731abcb232b7f27388bf9ded2 Author: wujing <realwujing@qq.com> Date: Sun Jun 8 19:43:06 2025 +0800
include/qemu/bitops.h: fix the preprocessor not recognizing the `sizeof` operator cat make_error.log In file included from /home/wujing/code/qemu-2.8+dfsg/include/qemu/hbitmap.h:15:0, from /home/wujing/code/qemu-2.8+dfsg/include/block/dirty-bitmap.h:5, from /home/wujing/code/qemu-2.8+dfsg/include/block/block.h:9, from /home/wujing/code/qemu-2.8+dfsg/include/block/block_int.h:28, from /home/wujing/code/qemu-2.8+dfsg/block/raw-posix.c:30: /usr/include/linux/swab.h: In function ‘__swab’: /home/wujing/code/qemu-2.8+dfsg/include/qemu/bitops.h:20:34: warning: "sizeof" is not defined [-Wundef] ^ /home/wujing/code/qemu-2.8+dfsg/include/qemu/bitops.h:20:41: error: missing binary operator before token "(" ^ make: *** [block/raw-posix.o] Error 1 make: *** 正在等待未完成的任务.... apt policy gcc gcc: 已安装:4:6.3.0-4 候选: 4:6.3.0-4 版本列表: *** 4:6.3.0-4 500 500 http://archive.debian.org/debian stretch/main amd64 Packages 100 /var/lib/dpkg/status - [qemu 安装 recipe for target 'block/file-posix.o' failed error: missing binary operator before token "(](https://blog.csdn.net/FJDJFKDJFKDJFKD/article/details/105982709) Signed-off-by: wujing <realwujing@qq.com> Signed-off-by: QiLiang Yuan <yuanql9@chinatelecom.cn>
diff --git a/include/qemu/bitops.h b/include/qemu/bitops.h index 1881284..cb49cbf 100644 --- a/include/qemu/bitops.h +++ b/include/qemu/bitops.h @@ -17,7 +17,7 @@ #include "atomic.h" #define BITS_PER_BYTE CHAR_BIT -#define BITS_PER_LONG (sizeof (unsigned long) * BITS_PER_BYTE) +#define BITS_PER_LONG (__SIZEOF_LONG__ * BITS_PER_BYTE) #define BIT(nr) (1UL << (nr)) #define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG))
|