Commit 4c05525f authored by Than McIntosh's avatar Than McIntosh

cmd/link: revise test case to work on pre-10.14 macos

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: default avatarDavid Chase <drchase@google.com>
parent 9e31b177
...@@ -3,12 +3,14 @@ ...@@ -3,12 +3,14 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <UserNotifications/UserNotifications.h> #import <AppKit/NSAppearance.h>
BOOL function(void) { 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, *)) { if (@available(macOS 10.14, *)) {
UNUserNotificationCenter *center = darkAppearance = [NSAppearance appearanceNamed:NSAppearanceNameDarkAqua];
[UNUserNotificationCenter currentNotificationCenter];
} }
#endif
return NO; return NO;
} }
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
package lib package lib
/* /*
#cgo darwin CFLAGS: -mmacosx-version-min=10.10 -D__MAC_OS_X_VERSION_MAX_ALLOWED=101450 -Wunguarded-availability-new #cgo darwin CFLAGS: -D__MAC_OS_X_VERSION_MAX_ALLOWED=101450
#cgo darwin LDFLAGS: -framework Foundation -framework UserNotifications #cgo darwin LDFLAGS: -framework Foundation -framework AppKit
#include "stdlib.h" #include "stdlib.h"
int function(void); int function(void);
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment