mingw-w64 i686-7.1.0编译SDL2 test程序
来源:互联网 发布:六度分隔理论 知乎 编辑:程序博客网 时间:2024/06/08 19:24
在使用mingw-w64 i686-7.1.0-posix-sjlj-rt_v5-rev0版编译SDL2 test程序的过程中,遇到如下错误
testatomic.c:106:1: note: in expansion of macro 'SDL_COMPILE_TIME_ASSERT'
SDL_COMPILE_TIME_ASSERT(size, CountTo>0); /* check for rollover */
换编译器mingw32单独编译该文件,却没有错误。
查看testatomic.c文件中的代码出错的位置
#define NThreads 2
#define CountInc 100
#define VALBITS (sizeof(atomicValue)*8)
#define atomicValue int
#define CountTo ((atomicValue)((unsigned int)(1<<(VALBITS-1))-1))
#define NInter (CountTo/CountInc/NThreads)
#define Expect (CountTo-NInter*CountInc*NThreads)
SDL_COMPILE_TIME_ASSERT(size, CountTo>0); /* check for rollover */
SDL_COMPILE_TIME_ASSERT应该是想测试把1左移31位后,是否发生溢出。输出CountTo的值为2147483647,按理应该能通过测试的。但不知是不是预处理器中有bug,实际该检测不能通过。对代码作如下修改,指明1为无符号类型,编译通过。
#define CountTo ((atomicValue)((unsigned int)(1u<<(VALBITS-1))-1))
- mingw-w64 i686-7.1.0编译SDL2 test程序
- mingw-w64 i686-7.1.0编译OpenGL超级宝典第五版示例程序
- MINGW-W64-I686-TOOLCHAIN
- i686-w64-mingw32编译win-vlc问题
- SDL2 Qt Mingw编译
- 使用Mingw-w64编译FreeImage
- MinGW-W64 编译 LLVM 与 Clang
- CMake+mingw-w64编译opencv-3.3.1
- 在MSYS2和MinGW-W64编译GCC6.3
- i686-w64-mingw32-gcc && gcc
- qt for mingw-w64
- mingw-w64-dgn
- mingw-w64相关
- MinGW 编译 GDIPlus 程序
- Eclipse CDT with MinGW w64
- windows下MinGW-w64安装
- Windows7下安装Mingw-w64
- windows下MinGW-w64安装
- Mysql Innodb体系结构
- 《Thinking in Java》——构造器是private时如何创建对象?
- Mac OSX下Sublime Text配置使用ctags实现代码跳转
- 【实训】第一周总结上
- nodejs 后台服务启动
- mingw-w64 i686-7.1.0编译SDL2 test程序
- 静态、动态全景图的制作方法
- UGUI新手引导开发(二、引导用ScriptableObject配置)
- Golang 中对文件 file 操作方法总结
- 三角形面积(float与double的区别)
- 谈谈加密那些事儿
- scala学习笔记
- 快速排序、堆排序、归并排序的python实现
- Python3 OS文件目录方法