aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/ProtoRPC/ProtoRPC.m
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2018-11-15 17:44:26 -0800
committerGravatar Muxi Yan <mxyan@google.com>2018-11-15 17:44:26 -0800
commit87abab45c99ab4b40718557cbc1c25dcd7f5a418 (patch)
tree036473770f13f977969b0d22fdb3948f55831571 /src/objective-c/ProtoRPC/ProtoRPC.m
parent512c01bc574ab09129608bc501d80f06503c79a3 (diff)
Fix version availability
Diffstat (limited to 'src/objective-c/ProtoRPC/ProtoRPC.m')
-rw-r--r--src/objective-c/ProtoRPC/ProtoRPC.m8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/objective-c/ProtoRPC/ProtoRPC.m b/src/objective-c/ProtoRPC/ProtoRPC.m
index 9f45bdfcd4..9164f2320b 100644
--- a/src/objective-c/ProtoRPC/ProtoRPC.m
+++ b/src/objective-c/ProtoRPC/ProtoRPC.m
@@ -105,11 +105,17 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing
_handler = handler;
_callOptions = [callOptions copy];
_responseClass = responseClass;
- if (@available(iOS 8.0, *)) {
+
+ // Set queue QoS only when iOS version is 8.0 or above and Xcode version is 9.0 or above
+#if __IPHONE_OS_VERSION_MAX_ALLOWED < 110000 || __MAC_OS_X_VERSION_MAX_ALLOWED < 101300
+ if (@available(iOS 8.0, macOS 10.10, *)) {
_dispatchQueue = dispatch_queue_create(
NULL,
dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_DEFAULT, 0));
} else {
+#else
+ {
+#endif
_dispatchQueue = dispatch_queue_create(nil, DISPATCH_QUEUE_SERIAL);
}
dispatch_set_target_queue(_dispatchQueue, handler.dispatchQueue);