]>
git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSShared/mDNSFeatures.h
2 * Copyright (c) 2019 Apple Inc. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __mDNSFeatures_h
18 #define __mDNSFeatures_h
20 #if MDNSRESPONDER_PLATFORM_APPLE
21 #include "ApplePlatformFeatures.h"
26 #undef MDNSRESPONDER_PLATFORM_COMMON
27 #define MDNSRESPONDER_PLATFORM_COMMON 1
30 // Radar: <rdar://problem/23226275>
31 // Enabled: Yes, for Apple.
33 #if !defined(MDNSRESPONDER_SUPPORTS_COMMON_DNS_PUSH)
34 #if defined(MDNSRESPONDER_PLATFORM_APPLE) && MDNSRESPONDER_PLATFORM_APPLE
35 #define MDNSRESPONDER_SUPPORTS_COMMON_DNS_PUSH 1
37 #define MDNSRESPONDER_SUPPORTS_COMMON_DNS_PUSH 0
41 #define HAS_FEATURE_CAT(A, B) A ## B
42 #define HAS_FEATURE_CHECK_0 1
43 #define HAS_FEATURE_CHECK_1 1
44 #define HAS_FEATURE(X) ((X) / HAS_FEATURE_CAT(HAS_FEATURE_CHECK_, X))
46 #define MDNSRESPONDER_SUPPORTS(PLATFORM, FEATURE) \
47 (defined(MDNSRESPONDER_PLATFORM_ ## PLATFORM) && MDNSRESPONDER_PLATFORM_ ## PLATFORM && \
48 HAS_FEATURE(MDNSRESPONDER_SUPPORTS_ ## PLATFORM ## _ ## FEATURE))
50 #endif // __mDNSFeatures_h