Fix enum typedef for older mac SDKs (flutter/engine#136)

This commit is contained in:
Dan Field
2022-04-13 21:53:57 -07:00
committed by Dan Field
parent 313f17df31
commit 75634a6ab9

View File

@@ -55,8 +55,8 @@ static CommandBuffer::Status ToCommitResult(MTLCommandBufferStatus status) {
// TODO(dnfield): remove this declaration when we no longer need to build on
// machines with lower SDK versions than 11.0.s
#if !defined(MAC_OS_X_VERSION_11_0) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_11_0
typedef enum MTLCommandEncoderErrorState : NSInteger {
#if !defined(MAC_OS_VERSION_11_0) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_VERSION_11_0
typedef NS_ENUM(NSInteger, MTLCommandEncoderErrorState) {
MTLCommandEncoderErrorStateUnknown = 0,
MTLCommandEncoderErrorStateCompleted = 1,
MTLCommandEncoderErrorStateAffected = 2,
@@ -65,6 +65,12 @@ typedef enum MTLCommandEncoderErrorState : NSInteger {
} API_AVAILABLE(macos(11.0), ios(14.0));
#endif
#if !defined(MAC_OS_VERSION_12_0) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_VERSION_12_0
constexpr int MTLCommandBufferErrorAccessRevoked = 4;
constexpr int MTLCommandBufferErrorStackOverflow = 12;
#endif
API_AVAILABLE(ios(14.0), macos(11.0))
NSString* MTLCommandEncoderErrorStateToString(
MTLCommandEncoderErrorState state) {