RESOLVED FIXED 128448
[Mac] Fix use of availability macros on recently-added APIs
https://bugs.webkit.org/show_bug.cgi?id=128448
Summary [Mac] Fix use of availability macros on recently-added APIs
Mark Rowe (bdash)
Reported 2014-02-07 23:41:12 PST
New API added to JavaScriptCore in r163590 and r163574 took a creative approach to availability macros. While it works, it is ugly, hard to follow, and doesn't allow the new APIs to be used by Safari or WebKit on anything but the current OS version. We can do better.
Attachments
Patch (7.61 KB, patch)
2014-02-07 23:51 PST, Mark Rowe (bdash)
no flags
Patch (7.65 KB, patch)
2014-02-08 00:05 PST, Mark Rowe (bdash)
mitz: review+
Mark Rowe (bdash)
Comment 1 2014-02-07 23:51:41 PST
WebKit Commit Bot
Comment 2 2014-02-07 23:53:53 PST
Attachment 223555 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/API/WebKitAvailability.h:42: Missing spaces around = [whitespace/operators] [4] Total errors found: 1 in 4 files If any of these errors are false positives, please file a bug against check-webkit-style.
Mark Rowe (bdash)
Comment 3 2014-02-08 00:05:51 PST
WebKit Commit Bot
Comment 4 2014-02-08 00:08:14 PST
Attachment 223558 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/API/WebKitAvailability.h:42: Missing spaces around = [whitespace/operators] [4] Total errors found: 1 in 4 files If any of these errors are false positives, please file a bug against check-webkit-style.
mitz
Comment 5 2014-02-08 00:10:22 PST
Comment on attachment 223558 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=223558&action=review > Source/JavaScriptCore/ChangeLog:10 > + newer OS X versions would expand in to when building on older OS versions. Typo: “in to”. > Source/JavaScriptCore/API/WebKitAvailability.h:63 > +#else /* __APPLE__ */ Comments next to #else are ambiguous and confusing. Either remove the comment or change to #endif followed by #ifndef (__APPLE__) > Source/JavaScriptCore/postprocess-headers.sh:12 > +for HEADER in JSBase.h JSContext.h JSManagedValue.h JSValue.h JSVirtualMachine.h WebKitAvailability.h; do It would be nicer to instead iterate over ${SCRIPT_INPUT_FILE_${i}} here for $i from 0 to $SCRIPT_INPUT_FILE_COUNT.
Mark Rowe (bdash)
Comment 6 2014-02-08 00:18:39 PST
(In reply to comment #5) > > Source/JavaScriptCore/postprocess-headers.sh:12 > > +for HEADER in JSBase.h JSContext.h JSManagedValue.h JSValue.h JSVirtualMachine.h WebKitAvailability.h; do > > It would be nicer to instead iterate over ${SCRIPT_INPUT_FILE_${i}} here for $i from 0 to $SCRIPT_INPUT_FILE_COUNT. This is a great idea. I'll do it in a follow-up patch.
Mark Rowe (bdash)
Comment 7 2014-02-08 00:56:18 PST
Mark Hahnenberg
Comment 8 2014-02-08 08:02:25 PST
(In reply to comment #7) > Committed r163707: <http://trac.webkit.org/changeset/163707> Thanks for fixing this! It was indeed quite a(n incorrect) hack.
Radu Stavila
Comment 9 2014-10-21 05:17:33 PDT
Comment on attachment 223558 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=223558&action=review > Source/JavaScriptCore/API/WebKitAvailability.h:42 > +#define __NSi_10_10 introduced=10.0 Is this (10.0 instead of 10.10) intentional?
Mark Rowe (bdash)
Comment 10 2014-10-21 09:59:18 PDT
(In reply to comment #9) > Comment on attachment 223558 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=223558&action=review > > > Source/JavaScriptCore/API/WebKitAvailability.h:42 > > +#define __NSi_10_10 introduced=10.0 > > Is this (10.0 instead of 10.10) intentional? Yes: #if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1090 /* To support availability macros that mention newer OS X versions when building on older OS X versions, we provide our own definitions of the underlying macros that the availability macros expand to. We're free to expand the macros as no-ops since frameworks built on older OS X versions only ship bundled with an application rather than as part of the system. */
Note You need to log in before you can comment on or make changes to this bug.