跨平台判断64位和32位开发的一些宏定义

时间:2025-03-25 08:11:16
#ifdef _WIN32
//windows x86 or x68
#ifdef _WIN64 //x64
    typedef uint64_t point_t;
#else //x86
    typedef uint32_t UPoint;
#endif //_WIN64
#else //unix
#ifdef __x86_64__ //x64
#elif __i386__ //x86
#endif
#endif //_WIN32

_WIN32是在Windows32位和64位都会有define的,所以区分64还是32位主要用到的是_WIN64,_WIN32只用作区分是否Windows系统

转载于:/pureLaw/p/