progrium / darwinkit

Native Mac APIs for Go. Previously known as MacDriver
MIT License
4.99k stars 158 forks source link

API_UNAVAILABLE() macro not handled #164

Closed programmingkidx closed 1 year ago

programmingkidx commented 1 year ago

MacDriver is a project that aims to make Apple's APIs available for easy use in Go. This project also includes the goal of being able to create programs not just for Mac OS but for WatchOS, iPadOS, iPhoneOS, TVOS. Perhaps even Windows and Linux one day. With these things in mind we currently don't honor the API_UNAVAILABLE() macro. This macro specifies that a method is not available for the specified operating system. When trying to build a program using MacDriver I saw this error:

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:236:1: note: 'preservationPriorityForTag:' has been explicitly marked unavailable here

I think we need to implement a system that allows the user to specify which operating system to be targeted.

programmingkidx commented 1 year ago

Three ways come to my mind on how to handle this:

progrium commented 1 year ago

Working on it. What platform were you trying?

programmingkidx commented 1 year ago

I only use Mac OS right now.

progrium commented 1 year ago

Unnecessary now