<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On May 10, 2013, at 2:57 AM, ivan <<a href="mailto:ivasic+clang@gmail.com">ivasic+clang@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Hi all,<br><br>It seems to me that clang_getCursorPlatformAvailability API in libclang<br>fails to find availability too often for OSX SDK APIs. Normally, for iOS it<br>seems to work much better even for the same Foundation APIs.<br><br>A few random examples (I have many examples) can be:<br><br> //in NSLayoutConstraint.h<br> - (void)layoutIfNeeded NS_AVAILABLE_MAC(10_7);<br><br> //in NSWindow.h<br> - (BOOL)preventsApplicationTerminationWhenModal NS_AVAILABLE_MAC(10_6);<br><br>I have a simple test Xcode project that reproduces this behaviour here:<span class="Apple-converted-space"> </span><br><a href="http://cl.ly/2B261r2X0H3y">http://cl.ly/2B261r2X0H3y</a><span class="Apple-converted-space"> </span><<a href="http://cl.ly/2B261r2X0H3y">http://cl.ly/2B261r2X0H3y</a>>  <br>(Just modify your Xcode path if it's not in standard location and build&run)<br><br>It's possible that I'm doing something wrong but the exact same code works<br>pretty well with iOS headers. Also, I'm really not sure about this but it<br>seems that it fails finding the availability mostly on methods while<br>classes, enums etc.. work okay.<br><br></div></blockquote><div><br></div></div>Have you looked at the preprocessed output in both cases? My guess is that the OS X APIs are mapping the availability macros down to unavailable/deprecated/nothing, rather than Clang's 'availability' attribute.<div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>- Doug</div></body></html>