cb424d7448
verify-patch-sanity.py validates every active recipe .patch has internally- consistent hunk line counts — catching the 'malformed patch at line N' failure at commit/CI/preflight time instead of hours into a cook. This cycle hit that class three times (qtwaylandscanner, sddm, xwayland), each only discovered when cookbook tried to apply the patch. Running it across the repo found 29 latent malformed patches (validated against GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22'). They were harmless only because they sit in vendored recipes (baked, not re- applied) — but would fail on any version-bump re-derivation. --fix recounts the hunk headers (body untouched) and repaired all 29. Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test (test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats (empty placeholders, bare-@@ git hunks).
34 lines
1.3 KiB
Objective-C
34 lines
1.3 KiB
Objective-C
// RUN: %clang_cc1 -fsyntax-only -Wunguarded-availability -Wno-unsupported-availability-guard -triple x86_64-apple-macosx10.10.0 -verify %s
|
|
|
|
void f(void) {
|
|
|
|
if (@available(macos 10.12, *)) {}
|
|
else if (@available(macos 10.11, *)) {}
|
|
else {}
|
|
|
|
(void)__builtin_available(ios 8, macos 10.10, *);
|
|
|
|
(void)@available(macos 10.11); // expected-error{{must handle potential future platforms with '*'}}
|
|
(void)@available(macos 10.11, macos 10.11, *); // expected-error{{version for 'macos' already specified}}
|
|
|
|
(void)@available(erik_os 10.11, *); // expected-error{{unrecognized platform name erik_os}}
|
|
|
|
(void)@available(erik_os 10.10, hat_os 1.0, *); // expected-error 2 {{unrecognized platform name}}
|
|
|
|
(void)@available(); // expected-error{{expected a platform name here}}
|
|
(void)@available(macos 10.10,); // expected-error{{expected a platform name here}}
|
|
(void)@available(macos); // expected-error{{expected a version}}
|
|
(void)@available; // expected-error{{expected '('}}
|
|
}
|
|
|
|
void prettyPlatformNames(void) {
|
|
(void)@available(iOS 8, tvOS 10, watchOS 3, macOS 10.11, *);
|
|
(void)__builtin_available(iOSApplicationExtension 8, tvOSApplicationExtension 10,
|
|
watchOSApplicationExtension 3, macOSApplicationExtension 10.11, *);
|
|
}
|
|
|
|
#if __has_builtin(__builtin_available)
|
|
#error expected
|
|
// expected-error@-1 {{expected}}
|
|
#endif
|