]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: revise test case to work on pre-10.14 macos
authorThan McIntosh <thanm@google.com>
Fri, 31 May 2019 16:05:07 +0000 (12:05 -0400)
committerThan McIntosh <thanm@google.com>
Fri, 31 May 2019 19:51:40 +0000 (19:51 +0000)
Rework this recently introduced test case to insure that it works with
older versions of the OS. It was using a new framework library not
available on pre-10.14 to trigger the weak symbol reference; switch to
using a new symbol from an existing library. Tested on MacOS 10.14 and
10.11.

Updates #32233.

Change-Id: I1fe2a9255fca46cb7cdf33ff7fed67bba86fdc22
Reviewed-on: https://go-review.googlesource.com/c/go/+/179837
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/link/internal/ld/testdata/issue32233/lib/ObjC.m
src/cmd/link/internal/ld/testdata/issue32233/lib/lib.go

index 78e6e9e252ce09075f88a5ddd7256ca229f76ce2..946278803e2257f3a31c20f8102dfdefa8350e72 100644 (file)
@@ -3,12 +3,14 @@
 // license that can be found in the LICENSE file.
 
 #import <Foundation/Foundation.h>
-#import <UserNotifications/UserNotifications.h>
+#import <AppKit/NSAppearance.h>
 
 BOOL function(void) {
+#if defined(MAC_OS_X_VERSION_MIN_REQUIRED) && (MAC_OS_X_VERSION_MIN_REQUIRED > 101300)
+  NSAppearance *darkAppearance;
   if (@available(macOS 10.14, *)) {
-    UNUserNotificationCenter *center =
-        [UNUserNotificationCenter currentNotificationCenter];
+    darkAppearance = [NSAppearance appearanceNamed:NSAppearanceNameDarkAqua];
   }
+#endif
   return NO;
 }
index efd56fb340adc33060887f21b60e35484896362c..514b9b9a4ab7f466120e4955bf40686f2eb2e19a 100644 (file)
@@ -5,8 +5,8 @@
 package lib
 
 /*
-#cgo darwin CFLAGS: -mmacosx-version-min=10.10 -D__MAC_OS_X_VERSION_MAX_ALLOWED=101450 -Wunguarded-availability-new
-#cgo darwin LDFLAGS: -framework Foundation -framework UserNotifications
+#cgo darwin CFLAGS: -D__MAC_OS_X_VERSION_MAX_ALLOWED=101450
+#cgo darwin LDFLAGS: -framework Foundation -framework AppKit
 #include "stdlib.h"
 int function(void);
 */