2 * Copyright (c) 2019-2020 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 * https://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 #import "dnssd_object.h"
20 #import <os/object_private.h>
22 //======================================================================================================================
23 // MARK: - Class Declarations
25 #define DNSSD_OBJECT_CLASS_DECLARE(NAME) \
26 _OS_OBJECT_DECL_SUBCLASS_INTERFACE(dnssd_ ## NAME, dnssd_object) \
27 extern int _dnssd_dummy_variable
29 _OS_OBJECT_DECL_SUBCLASS_INTERFACE(dnssd_object, object)
31 DNSSD_OBJECT_CLASS_DECLARE(getaddrinfo);
32 DNSSD_OBJECT_CLASS_DECLARE(getaddrinfo_result);
33 DNSSD_OBJECT_CLASS_DECLARE(cname_array);
35 //======================================================================================================================
36 // MARK: - Class Definitions
38 @implementation OS_OBJECT_CLASS(dnssd_object)
41 dnssd_object_finalize(self);
46 #define DNSSD_CLASS(NAME) OS_OBJECT_CLASS(dnssd_ ## NAME)
47 #define DNSSD_OBJECT_CLASS_DEFINE(NAME) \
48 @implementation DNSSD_CLASS(NAME) \
51 dnssd_ ## NAME ## _t \
52 dnssd_object_ ## NAME ## _alloc(const size_t size) \
54 return (dnssd_## NAME ##_t)_os_object_alloc([DNSSD_CLASS(NAME) class], size); \
56 extern int _dnssd_dummy_variable
58 DNSSD_OBJECT_CLASS_DEFINE(getaddrinfo);
59 DNSSD_OBJECT_CLASS_DEFINE(getaddrinfo_result);
60 DNSSD_OBJECT_CLASS_DEFINE(cname_array);