小弟我就想不通 if defined (WIN32) 和 if defined WIN32 之间有什么区别
我就想不通 if defined (WIN32) 和 if defined WIN32 之间有什么区别?
#if defined (WIN32)
#include <io.h>
#include <sys/stat.h>
#elif (defined (UNIX) && defined(_LARGEFILE64_SOURCE))
#include <sys/types.h>
#include <unistd.h>
#include <limits.h>
#endif
if defined (WIN32) 为什么不直接写成 if defined WIN32? 难道两者间有什么区别?
------解决方案--------------------
习惯问题
------解决方案--------------------
一般是把后面的东西加括弧,而不是加在宏本身上.
------解决方案--------------------
一般是
#define WIN32 (.....)
...
# if defined WIN32
#if defined (WIN32)
#include <io.h>
#include <sys/stat.h>
#elif (defined (UNIX) && defined(_LARGEFILE64_SOURCE))
#include <sys/types.h>
#include <unistd.h>
#include <limits.h>
#endif
if defined (WIN32) 为什么不直接写成 if defined WIN32? 难道两者间有什么区别?
------解决方案--------------------
习惯问题
------解决方案--------------------
一般是把后面的东西加括弧,而不是加在宏本身上.
------解决方案--------------------
一般是
#define WIN32 (.....)
...
# if defined WIN32