Skip to content

Commit 999978f

Browse files
committed
Fix enum typedef for older mac SDKs (flutter#136)
1 parent f6508c1 commit 999978f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

impeller/renderer/backend/metal/command_buffer_mtl.mm

+8-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555

5656
// TODO(dnfield): remove this declaration when we no longer need to build on
5757
// machines with lower SDK versions than 11.0.s
58-
#if !defined(MAC_OS_X_VERSION_11_0) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_11_0
59-
typedef enum MTLCommandEncoderErrorState : NSInteger {
58+
#if !defined(MAC_OS_VERSION_11_0) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_VERSION_11_0
59+
typedef NS_ENUM(NSInteger, MTLCommandEncoderErrorState) {
6060
MTLCommandEncoderErrorStateUnknown = 0,
6161
MTLCommandEncoderErrorStateCompleted = 1,
6262
MTLCommandEncoderErrorStateAffected = 2,
@@ -65,6 +65,12 @@
6565
} API_AVAILABLE(macos(11.0), ios(14.0));
6666
#endif
6767

68+
69+
#if !defined(MAC_OS_VERSION_12_0) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_VERSION_12_0
70+
constexpr int MTLCommandBufferErrorAccessRevoked = 4;
71+
constexpr int MTLCommandBufferErrorStackOverflow = 12;
72+
#endif
73+
6874
API_AVAILABLE(ios(14.0), macos(11.0))
6975
NSString* MTLCommandEncoderErrorStateToString(
7076
MTLCommandEncoderErrorState state) {

0 commit comments

Comments
 (0)