Skip to content

Commit

Permalink
Fix enum typedef for older mac SDKs (flutter#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnfield committed Apr 27, 2022
1 parent f6508c1 commit 999978f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions impeller/renderer/backend/metal/command_buffer_mtl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@

// 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,
Expand All @@ -65,6 +65,12 @@
} 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) {
Expand Down

0 comments on commit 999978f

Please sign in to comment.