我有一个适用于 Xcode 3.2.6 和 10.4u SDK 的旧项目...
将其移至 10.8 SDK 和 LLVM 5 时,我得到了一些未知类型:
错误:
Error: unknown type name 'Handle'
typedef Handle OSMenuBar; // Handle to Mac Menu Bar
^
这是代码:
#if TARGET_OS_MAC
typedef Handle OSMenuBar; // Handle to Mac Menu Bar
typedef MenuRef OSMenu; // Opaque reference to Mac Menu
typedef WindowRef OSWindow; // Opaque reference to Mac Window
typedef Handle OSHandle; // Mac Handle
typedef ControlRef OSControl; // Opaque reference to Mac Control
typedef Ptr OSPtr; // Mac memory Ptr
typedef SInt16 OSFileRef; // Mac file reference number
typedef IconRef OSIconRef; // Mac IconRef
typedef FSVolumeRefNum OSVolume; // Mac volume ref num
typedef WindowClass OSWindowClass; // Mac WindowClass
typedef CGContextRef OSCGContextRef; // Mac Quartz context ref
typedef DataBrowserItemID OSDataBrowserItemID; // DataBrowser item id
typedef DataBrowserPropertyID OSDataBrowserPropertyID; // DataBrowser property id
typedef DataBrowserItemDataRef OSDataBrowserItemDataRef; // DataBrowserItemDataRef
#pragma warning "TODO -- No QuickDraw for what OS 10.5???"
typedef GrafPtr OSGraphicsPort; // Mac GrafPtr
typedef GWorldPtr OSImageList; // Mac GWorld containing images
typedef CIconHandle OSColorIcon; // Mac CIcon
typedef Handle OSIconSuite; // Mac Icon Suite Handle
typedef PicHandle OSPicture; // Mac Picture Handle
typedef RgnHandle OSRegion; // Mac Region
#endif
所有这些 TypeDef 似乎都会产生相同的未知类型错误。
我如何最好地解决这个问题?