Add dyldSPI.h for linked on or after checks, and add one for link preview
Created attachment 278206 [details]
Comment on attachment 278206 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=278206&action=review
> + * Copyright (C) 2015 Apple Inc. All rights reserved.
Pretty sure this is all new 2016 stuff.
> +#ifndef WTF_dyldSPI_h
> +#define WTF_dyldSPI_h
We’ve switched to using #pragma once in new files
> +#if PLATFORM(APPLETV)
> +#elif PLATFORM(IOS)
> +static const uint32_t firstSDKVersionWithInitConstructorSupport = 0x80000; // iOS 8.0.0
> +static const uint32_t firstSDKVersionWithLinkPreviewEnabledByDefault = 0xA0000;
> +#elif PLATFORM(MAC)
> +static const uint32_t firstSDKVersionWithInitConstructorSupport = 0xA0A00; // OSX 10.10.0
This things are neither dyld SPI nor WTF-related. They should stay in their respective projects.
> + @discussion The default value is NO on iOS 9, and YES on iOS linked on or after WK_IOS_TBS.
TBS? The script that post-processes API headers is not going to do anything pretty with this WK_IOS_TBS (nor with WK_IOS_TBA). More importantly, anyone seeing this comment will be looking at the iOS TBA SDK, and therefore linking against that SDK. There’s no need to confuse them with telling them about behavior that won’t apply to them.
> + static uint32_t programSDKVersion = 0;
> + if (!programSDKVersion)
> + programSDKVersion = dyld_get_program_sdk_version();
Since this is C++, you just say
static uint32_t programSDKVersion = dyld_get_program_sdk_version();
and it will do one-time initialization.
Created attachment 278757 [details]
Created attachment 278767 [details]
Created attachment 278778 [details]
Comment on attachment 278778 [details]
I kind of want all these quirk policies gathered in one place in the future. The actual quirks have to be spread around, but I wish all the functions that define the various minimum versions for the expiration various old behaviors were grouped together.
http://trac.webkit.org/changeset/200866 Thanks Darin! I agree, that would be great. I was not aware that this was the "best" way to write a quirk until I started working on this and talking to Dan. There are still lot of (recent!) examples in the code that that take a similar-yet-different approach.
Build fix: http://trac.webkit.org/changeset/200867