Bitcointalk · BSD detection

中本聪,2010 年 8 月 12 日

SN-2288 已核对来源,附原文与上下文。

阅读语言
中文译文

headers.h 里有这样一段代码: #ifdef __WXMAC_OSX__ #define __WXMAC__ 1 #define __WXOSX__ 1 #define __BSD__ 1 #endif #endif

那段代码本来就是个馊主意,我要删了它。Mac 相关代码应该只用 __WXMAC_OSX__,不要用 __WXMAC__ 或 __WXOSX__,我们也该停用 __BSD__。

#if (defined(__unix__) || defined(unix)) && !defined(USG) #include #endif

这能保证 Mac 上 BSD 一定被定义吗?

ORIGINAL · 英文原文
There is this piece of code in headers.h:

#ifdef __WXMAC_OSX__
#define __WXMAC__ 1
#define __WXOSX__ 1
#define __BSD__ 1
#endif
#endif

That code was a bad idea anyway, I'm deleting it.  Any Mac code should only use __WXMAC_OSX__, not __WXMAC__ or __WXOSX__, and we should stop using __BSD__.

Quote

#if (defined(__unix__) || defined(unix)) && !defined(USG)
#include <sys/param.h>
#endif

Will that definitely cause BSD to be defined on Mac?
来源
Bitcointalk 原始链接 ↗ 记录编号 SN-2288