yum-mirror/VkFFT

git clone https://git.yummers.dev/yum-mirror/VkFFT

Tolmachev DmitriiMetal support in VkFFTba7001c

develop
18.8 KiB488 linesraw
1//-------------------------------------------------------------------------------------------------------------------------------------------------------------
2//
3// Foundation/NSPrivate.hpp
4//
5// Copyright 2020-2021 Apple Inc.
6//
7// Licensed under the Apache License, Version 2.0 (the "License");
8// you may not use this file except in compliance with the License.
9// You may obtain a copy of the License at
10//
11//     http://www.apache.org/licenses/LICENSE-2.0
12//
13// Unless required by applicable law or agreed to in writing, software
14// distributed under the License is distributed on an "AS IS" BASIS,
15// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16// See the License for the specific language governing permissions and
17// limitations under the License.
18//
19//-------------------------------------------------------------------------------------------------------------------------------------------------------------
20
21#pragma once
22
23//-------------------------------------------------------------------------------------------------------------------------------------------------------------
24
25#include <objc/runtime.h>
26
27//-------------------------------------------------------------------------------------------------------------------------------------------------------------
28
29#define _NS_PRIVATE_CLS(symbol) (Private::Class::s_k##symbol)
30#define _NS_PRIVATE_SEL(accessor) (Private::Selector::s_k##accessor)
31
32//-------------------------------------------------------------------------------------------------------------------------------------------------------------
33
34#if defined(NS_PRIVATE_IMPLEMENTATION)
35
36#define _NS_PRIVATE_VISIBILITY __attribute__((visibility("default")))
37#define _NS_PRIVATE_IMPORT __attribute__((weak_import))
38
39#if __OBJC__
40#define _NS_PRIVATE_OBJC_LOOKUP_CLASS(symbol) ((__bridge void*)objc_lookUpClass(#symbol))
41#else
42#define _NS_PRIVATE_OBJC_LOOKUP_CLASS(symbol) objc_lookUpClass(#symbol)
43#endif // __OBJC__
44
45#define _NS_PRIVATE_DEF_CLS(symbol) void* s_k##symbol _NS_PRIVATE_VISIBILITY = _NS_PRIVATE_OBJC_LOOKUP_CLASS(symbol);
46#define _NS_PRIVATE_DEF_PRO(symbol)
47#define _NS_PRIVATE_DEF_SEL(accessor, symbol) SEL s_k##accessor _NS_PRIVATE_VISIBILITY = sel_registerName(symbol);
48#define _NS_PRIVATE_DEF_CONST(type, symbol)              \
49    _NS_EXTERN type const NS##symbol _NS_PRIVATE_IMPORT; \
50    type const                       NS::symbol = (nullptr != &NS##symbol) ? NS##symbol : nullptr;
51
52#else
53
54#define _NS_PRIVATE_DEF_CLS(symbol) extern void* s_k##symbol;
55#define _NS_PRIVATE_DEF_PRO(symbol)
56#define _NS_PRIVATE_DEF_SEL(accessor, symbol) extern SEL s_k##accessor;
57#define _NS_PRIVATE_DEF_CONST(type, symbol)
58
59#endif // NS_PRIVATE_IMPLEMENTATION
60
61//-------------------------------------------------------------------------------------------------------------------------------------------------------------
62
63namespace NS
64{
65namespace Private
66{
67    namespace Class
68    {
69
70        _NS_PRIVATE_DEF_CLS(NSArray);
71        _NS_PRIVATE_DEF_CLS(NSAutoreleasePool);
72        _NS_PRIVATE_DEF_CLS(NSBundle);
73        _NS_PRIVATE_DEF_CLS(NSCondition);
74        _NS_PRIVATE_DEF_CLS(NSDate);
75        _NS_PRIVATE_DEF_CLS(NSDictionary);
76        _NS_PRIVATE_DEF_CLS(NSError);
77        _NS_PRIVATE_DEF_CLS(NSNumber);
78        _NS_PRIVATE_DEF_CLS(NSObject);
79        _NS_PRIVATE_DEF_CLS(NSProcessInfo);
80        _NS_PRIVATE_DEF_CLS(NSString);
81        _NS_PRIVATE_DEF_CLS(NSURL);
82        _NS_PRIVATE_DEF_CLS(NSValue);
83
84    } // Class
85} // Private
86} // MTL
87
88//-------------------------------------------------------------------------------------------------------------------------------------------------------------
89
90namespace NS
91{
92namespace Private
93{
94    namespace Protocol
95    {
96
97    } // Protocol
98} // Private
99} // NS
100
101//-------------------------------------------------------------------------------------------------------------------------------------------------------------
102
103namespace NS
104{
105namespace Private
106{
107    namespace Selector
108    {
109
110        _NS_PRIVATE_DEF_SEL(addObject_,
111            "addObject:");
112        _NS_PRIVATE_DEF_SEL(activeProcessorCount,
113            "activeProcessorCount");
114        _NS_PRIVATE_DEF_SEL(allBundles,
115            "allBundles");
116        _NS_PRIVATE_DEF_SEL(allFrameworks,
117            "allFrameworks");
118        _NS_PRIVATE_DEF_SEL(allObjects,
119            "allObjects");
120        _NS_PRIVATE_DEF_SEL(alloc,
121            "alloc");
122        _NS_PRIVATE_DEF_SEL(appStoreReceiptURL,
123            "appStoreReceiptURL");
124        _NS_PRIVATE_DEF_SEL(arguments,
125            "arguments");
126        _NS_PRIVATE_DEF_SEL(array,
127            "array");
128        _NS_PRIVATE_DEF_SEL(arrayWithObject_,
129            "arrayWithObject:");
130        _NS_PRIVATE_DEF_SEL(arrayWithObjects_count_,
131            "arrayWithObjects:count:");
132        _NS_PRIVATE_DEF_SEL(automaticTerminationSupportEnabled,
133            "automaticTerminationSupportEnabled");
134        _NS_PRIVATE_DEF_SEL(autorelease,
135            "autorelease");
136        _NS_PRIVATE_DEF_SEL(beginActivityWithOptions_reason_,
137            "beginActivityWithOptions:reason:");
138        _NS_PRIVATE_DEF_SEL(boolValue,
139            "boolValue");
140        _NS_PRIVATE_DEF_SEL(broadcast,
141            "broadcast");
142        _NS_PRIVATE_DEF_SEL(builtInPlugInsPath,
143            "builtInPlugInsPath");
144        _NS_PRIVATE_DEF_SEL(builtInPlugInsURL,
145            "builtInPlugInsURL");
146        _NS_PRIVATE_DEF_SEL(bundleIdentifier,
147            "bundleIdentifier");
148        _NS_PRIVATE_DEF_SEL(bundlePath,
149            "bundlePath");
150        _NS_PRIVATE_DEF_SEL(bundleURL,
151            "bundleURL");
152        _NS_PRIVATE_DEF_SEL(bundleWithPath_,
153            "bundleWithPath:");
154        _NS_PRIVATE_DEF_SEL(bundleWithURL_,
155            "bundleWithURL:");
156        _NS_PRIVATE_DEF_SEL(characterAtIndex_,
157            "characterAtIndex:");
158        _NS_PRIVATE_DEF_SEL(charValue,
159            "charValue");
160        _NS_PRIVATE_DEF_SEL(countByEnumeratingWithState_objects_count_,
161            "countByEnumeratingWithState:objects:count:");
162        _NS_PRIVATE_DEF_SEL(cStringUsingEncoding_,
163            "cStringUsingEncoding:");
164        _NS_PRIVATE_DEF_SEL(code,
165            "code");
166        _NS_PRIVATE_DEF_SEL(compare_,
167            "compare:");
168        _NS_PRIVATE_DEF_SEL(copy,
169            "copy");
170        _NS_PRIVATE_DEF_SEL(count,
171            "count");
172        _NS_PRIVATE_DEF_SEL(dateWithTimeIntervalSinceNow_,
173            "dateWithTimeIntervalSinceNow:");
174        _NS_PRIVATE_DEF_SEL(descriptionWithLocale_,
175            "descriptionWithLocale:");
176        _NS_PRIVATE_DEF_SEL(disableAutomaticTermination_,
177            "disableAutomaticTermination:");
178        _NS_PRIVATE_DEF_SEL(disableSuddenTermination,
179            "disableSuddenTermination");
180        _NS_PRIVATE_DEF_SEL(debugDescription,
181            "debugDescription");
182        _NS_PRIVATE_DEF_SEL(description,
183            "description");
184        _NS_PRIVATE_DEF_SEL(dictionary,
185            "dictionary");
186        _NS_PRIVATE_DEF_SEL(dictionaryWithObject_forKey_,
187            "dictionaryWithObject:forKey:");
188        _NS_PRIVATE_DEF_SEL(dictionaryWithObjects_forKeys_count_,
189            "dictionaryWithObjects:forKeys:count:");
190        _NS_PRIVATE_DEF_SEL(domain,
191            "domain");
192        _NS_PRIVATE_DEF_SEL(doubleValue,
193            "doubleValue");
194        _NS_PRIVATE_DEF_SEL(drain,
195            "drain");
196        _NS_PRIVATE_DEF_SEL(enableAutomaticTermination_,
197            "enableAutomaticTermination:");
198        _NS_PRIVATE_DEF_SEL(enableSuddenTermination,
199            "enableSuddenTermination");
200        _NS_PRIVATE_DEF_SEL(endActivity_,
201            "endActivity:");
202        _NS_PRIVATE_DEF_SEL(environment,
203            "environment");
204        _NS_PRIVATE_DEF_SEL(errorWithDomain_code_userInfo_,
205            "errorWithDomain:code:userInfo:");
206        _NS_PRIVATE_DEF_SEL(executablePath,
207            "executablePath");
208        _NS_PRIVATE_DEF_SEL(executableURL,
209            "executableURL");
210        _NS_PRIVATE_DEF_SEL(fileSystemRepresentation,
211            "fileSystemRepresentation");
212        _NS_PRIVATE_DEF_SEL(fileURLWithPath_,
213            "fileURLWithPath:");
214        _NS_PRIVATE_DEF_SEL(floatValue,
215            "floatValue");
216        _NS_PRIVATE_DEF_SEL(fullUserName,
217            "fullUserName");
218        _NS_PRIVATE_DEF_SEL(getValue_size_,
219            "getValue:size:");
220        _NS_PRIVATE_DEF_SEL(globallyUniqueString,
221            "globallyUniqueString");
222        _NS_PRIVATE_DEF_SEL(hash,
223            "hash");
224        _NS_PRIVATE_DEF_SEL(hostName,
225            "hostName");
226        _NS_PRIVATE_DEF_SEL(infoDictionary,
227            "infoDictionary");
228        _NS_PRIVATE_DEF_SEL(init,
229            "init");
230        _NS_PRIVATE_DEF_SEL(initFileURLWithPath_,
231            "initFileURLWithPath:");
232        _NS_PRIVATE_DEF_SEL(initWithBool_,
233            "initWithBool:");
234        _NS_PRIVATE_DEF_SEL(initWithBytes_objCType_,
235            "initWithBytes:objCType:");
236        _NS_PRIVATE_DEF_SEL(initWithBytesNoCopy_length_encoding_freeWhenDone_,
237            "initWithBytesNoCopy:length:encoding:freeWhenDone:");
238        _NS_PRIVATE_DEF_SEL(initWithChar_,
239            "initWithChar:");
240        _NS_PRIVATE_DEF_SEL(initWithCoder_,
241            "initWithCoder:");
242        _NS_PRIVATE_DEF_SEL(initWithCString_encoding_,
243            "initWithCString:encoding:");
244        _NS_PRIVATE_DEF_SEL(initWithDomain_code_userInfo_,
245            "initWithDomain:code:userInfo:");
246        _NS_PRIVATE_DEF_SEL(initWithDouble_,
247            "initWithDouble:");
248        _NS_PRIVATE_DEF_SEL(initWithFloat_,
249            "initWithFloat:");
250        _NS_PRIVATE_DEF_SEL(initWithInt_,
251            "initWithInt:");
252        _NS_PRIVATE_DEF_SEL(initWithLong_,
253            "initWithLong:");
254        _NS_PRIVATE_DEF_SEL(initWithLongLong_,
255            "initWithLongLong:");
256        _NS_PRIVATE_DEF_SEL(initWithObjects_count_,
257            "initWithObjects:count:");
258        _NS_PRIVATE_DEF_SEL(initWithObjects_forKeys_count_,
259            "initWithObjects:forKeys:count:");
260        _NS_PRIVATE_DEF_SEL(initWithPath_,
261            "initWithPath:");
262        _NS_PRIVATE_DEF_SEL(initWithShort_,
263            "initWithShort:");
264        _NS_PRIVATE_DEF_SEL(initWithString_,
265            "initWithString:");
266        _NS_PRIVATE_DEF_SEL(initWithUnsignedChar_,
267            "initWithUnsignedChar:");
268        _NS_PRIVATE_DEF_SEL(initWithUnsignedInt_,
269            "initWithUnsignedInt:");
270        _NS_PRIVATE_DEF_SEL(initWithUnsignedLong_,
271            "initWithUnsignedLong:");
272        _NS_PRIVATE_DEF_SEL(initWithUnsignedLongLong_,
273            "initWithUnsignedLongLong:");
274        _NS_PRIVATE_DEF_SEL(initWithUnsignedShort_,
275            "initWithUnsignedShort:");
276        _NS_PRIVATE_DEF_SEL(initWithURL_,
277            "initWithURL:");
278        _NS_PRIVATE_DEF_SEL(integerValue,
279            "integerValue");
280        _NS_PRIVATE_DEF_SEL(intValue,
281            "intValue");
282        _NS_PRIVATE_DEF_SEL(isEqual_,
283            "isEqual:");
284        _NS_PRIVATE_DEF_SEL(isEqualToNumber_,
285            "isEqualToNumber:");
286        _NS_PRIVATE_DEF_SEL(isEqualToString_,
287            "isEqualToString:");
288        _NS_PRIVATE_DEF_SEL(isEqualToValue_,
289            "isEqualToValue:");
290        _NS_PRIVATE_DEF_SEL(isiOSAppOnMac,
291            "isiOSAppOnMac");
292        _NS_PRIVATE_DEF_SEL(isLoaded,
293            "isLoaded");
294        _NS_PRIVATE_DEF_SEL(isLowPowerModeEnabled,
295            "isLowPowerModeEnabled");
296        _NS_PRIVATE_DEF_SEL(isMacCatalystApp,
297            "isMacCatalystApp");
298        _NS_PRIVATE_DEF_SEL(isOperatingSystemAtLeastVersion_,
299            "isOperatingSystemAtLeastVersion:");
300        _NS_PRIVATE_DEF_SEL(keyEnumerator,
301            "keyEnumerator");
302        _NS_PRIVATE_DEF_SEL(length,
303            "length");
304        _NS_PRIVATE_DEF_SEL(lengthOfBytesUsingEncoding_,
305            "lengthOfBytesUsingEncoding:");
306        _NS_PRIVATE_DEF_SEL(load,
307            "load");
308        _NS_PRIVATE_DEF_SEL(loadAndReturnError_,
309            "loadAndReturnError:");
310        _NS_PRIVATE_DEF_SEL(localizedDescription,
311            "localizedDescription");
312        _NS_PRIVATE_DEF_SEL(localizedFailureReason,
313            "localizedFailureReason");
314        _NS_PRIVATE_DEF_SEL(localizedInfoDictionary,
315            "localizedInfoDictionary");
316        _NS_PRIVATE_DEF_SEL(localizedRecoveryOptions,
317            "localizedRecoveryOptions");
318        _NS_PRIVATE_DEF_SEL(localizedRecoverySuggestion,
319            "localizedRecoverySuggestion");
320        _NS_PRIVATE_DEF_SEL(localizedStringForKey_value_table_,
321            "localizedStringForKey:value:table:");
322        _NS_PRIVATE_DEF_SEL(lock,
323            "lock");
324        _NS_PRIVATE_DEF_SEL(longValue,
325            "longValue");
326        _NS_PRIVATE_DEF_SEL(longLongValue,
327            "longLongValue");
328        _NS_PRIVATE_DEF_SEL(mainBundle,
329            "mainBundle");
330        _NS_PRIVATE_DEF_SEL(maximumLengthOfBytesUsingEncoding_,
331            "maximumLengthOfBytesUsingEncoding:");
332        _NS_PRIVATE_DEF_SEL(methodSignatureForSelector_,
333            "methodSignatureForSelector:");
334        _NS_PRIVATE_DEF_SEL(mutableBytes,
335            "mutableBytes");
336        _NS_PRIVATE_DEF_SEL(name,
337            "name");
338        _NS_PRIVATE_DEF_SEL(nextObject,
339            "nextObject");
340        _NS_PRIVATE_DEF_SEL(numberWithBool_,
341            "numberWithBool:");
342        _NS_PRIVATE_DEF_SEL(numberWithChar_,
343            "numberWithChar:");
344        _NS_PRIVATE_DEF_SEL(numberWithDouble_,
345            "numberWithDouble:");
346        _NS_PRIVATE_DEF_SEL(numberWithFloat_,
347            "numberWithFloat:");
348        _NS_PRIVATE_DEF_SEL(numberWithInt_,
349            "numberWithInt:");
350        _NS_PRIVATE_DEF_SEL(numberWithLong_,
351            "numberWithLong:");
352        _NS_PRIVATE_DEF_SEL(numberWithLongLong_,
353            "numberWithLongLong:");
354        _NS_PRIVATE_DEF_SEL(numberWithShort_,
355            "numberWithShort:");
356        _NS_PRIVATE_DEF_SEL(numberWithUnsignedChar_,
357            "numberWithUnsignedChar:");
358        _NS_PRIVATE_DEF_SEL(numberWithUnsignedInt_,
359            "numberWithUnsignedInt:");
360        _NS_PRIVATE_DEF_SEL(numberWithUnsignedLong_,
361            "numberWithUnsignedLong:");
362        _NS_PRIVATE_DEF_SEL(numberWithUnsignedLongLong_,
363            "numberWithUnsignedLongLong:");
364        _NS_PRIVATE_DEF_SEL(numberWithUnsignedShort_,
365            "numberWithUnsignedShort:");
366        _NS_PRIVATE_DEF_SEL(objCType,
367            "objCType");
368        _NS_PRIVATE_DEF_SEL(object,
369            "object");
370        _NS_PRIVATE_DEF_SEL(objectAtIndex_,
371            "objectAtIndex:");
372        _NS_PRIVATE_DEF_SEL(objectForInfoDictionaryKey_,
373            "objectForInfoDictionaryKey:");
374        _NS_PRIVATE_DEF_SEL(objectForKey_,
375            "objectForKey:");
376        _NS_PRIVATE_DEF_SEL(operatingSystem,
377            "operatingSystem");
378        _NS_PRIVATE_DEF_SEL(operatingSystemVersion,
379            "operatingSystemVersion");
380        _NS_PRIVATE_DEF_SEL(operatingSystemVersionString,
381            "operatingSystemVersionString");
382        _NS_PRIVATE_DEF_SEL(pathForAuxiliaryExecutable_,
383            "pathForAuxiliaryExecutable:");
384        _NS_PRIVATE_DEF_SEL(performActivityWithOptions_reason_usingBlock_,
385            "performActivityWithOptions:reason:usingBlock:");
386        _NS_PRIVATE_DEF_SEL(performExpiringActivityWithReason_usingBlock_,
387            "performExpiringActivityWithReason:usingBlock:");
388        _NS_PRIVATE_DEF_SEL(physicalMemory,
389            "physicalMemory");
390        _NS_PRIVATE_DEF_SEL(pointerValue,
391            "pointerValue");
392        _NS_PRIVATE_DEF_SEL(preflightAndReturnError_,
393            "preflightAndReturnError:");
394        _NS_PRIVATE_DEF_SEL(privateFrameworksPath,
395            "privateFrameworksPath");
396        _NS_PRIVATE_DEF_SEL(privateFrameworksURL,
397            "privateFrameworksURL");
398        _NS_PRIVATE_DEF_SEL(processIdentifier,
399            "processIdentifier");
400        _NS_PRIVATE_DEF_SEL(processInfo,
401            "processInfo");
402        _NS_PRIVATE_DEF_SEL(processName,
403            "processName");
404        _NS_PRIVATE_DEF_SEL(processorCount,
405            "processorCount");
406        _NS_PRIVATE_DEF_SEL(rangeOfString_options_,
407            "rangeOfString:options:");
408        _NS_PRIVATE_DEF_SEL(release,
409            "release");
410        _NS_PRIVATE_DEF_SEL(resourcePath,
411            "resourcePath");
412        _NS_PRIVATE_DEF_SEL(resourceURL,
413            "resourceURL");
414        _NS_PRIVATE_DEF_SEL(respondsToSelector_,
415            "respondsToSelector:");
416        _NS_PRIVATE_DEF_SEL(retain,
417            "retain");
418        _NS_PRIVATE_DEF_SEL(retainCount,
419            "retainCount");
420        _NS_PRIVATE_DEF_SEL(setAutomaticTerminationSupportEnabled_,
421            "setAutomaticTerminationSupportEnabled:");
422        _NS_PRIVATE_DEF_SEL(setProcessName_,
423            "setProcessName:");
424        _NS_PRIVATE_DEF_SEL(sharedFrameworksPath,
425            "sharedFrameworksPath");
426        _NS_PRIVATE_DEF_SEL(sharedFrameworksURL,
427            "sharedFrameworksURL");
428        _NS_PRIVATE_DEF_SEL(sharedSupportPath,
429            "sharedSupportPath");
430        _NS_PRIVATE_DEF_SEL(sharedSupportURL,
431            "sharedSupportURL");
432        _NS_PRIVATE_DEF_SEL(shortValue,
433            "shortValue");
434        _NS_PRIVATE_DEF_SEL(showPools,
435            "showPools");
436        _NS_PRIVATE_DEF_SEL(signal,
437            "signal");
438        _NS_PRIVATE_DEF_SEL(string,
439            "string");
440        _NS_PRIVATE_DEF_SEL(stringValue,
441            "stringValue");
442        _NS_PRIVATE_DEF_SEL(stringWithString_,
443            "stringWithString:");
444        _NS_PRIVATE_DEF_SEL(stringWithCString_encoding_,
445            "stringWithCString:encoding:");
446        _NS_PRIVATE_DEF_SEL(stringByAppendingString_,
447            "stringByAppendingString:");
448        _NS_PRIVATE_DEF_SEL(systemUptime,
449            "systemUptime");
450        _NS_PRIVATE_DEF_SEL(thermalState,
451            "thermalState");
452        _NS_PRIVATE_DEF_SEL(unload,
453            "unload");
454        _NS_PRIVATE_DEF_SEL(unlock,
455            "unlock");
456        _NS_PRIVATE_DEF_SEL(unsignedCharValue,
457            "unsignedCharValue");
458        _NS_PRIVATE_DEF_SEL(unsignedIntegerValue,
459            "unsignedIntegerValue");
460        _NS_PRIVATE_DEF_SEL(unsignedIntValue,
461            "unsignedIntValue");
462        _NS_PRIVATE_DEF_SEL(unsignedLongValue,
463            "unsignedLongValue");
464        _NS_PRIVATE_DEF_SEL(unsignedLongLongValue,
465            "unsignedLongLongValue");
466        _NS_PRIVATE_DEF_SEL(unsignedShortValue,
467            "unsignedShortValue");
468        _NS_PRIVATE_DEF_SEL(URLForAuxiliaryExecutable_,
469            "URLForAuxiliaryExecutable:");
470        _NS_PRIVATE_DEF_SEL(userInfo,
471            "userInfo");
472        _NS_PRIVATE_DEF_SEL(userName,
473            "userName");
474        _NS_PRIVATE_DEF_SEL(UTF8String,
475            "UTF8String");
476        _NS_PRIVATE_DEF_SEL(valueWithBytes_objCType_,
477            "valueWithBytes:objCType:");
478        _NS_PRIVATE_DEF_SEL(valueWithPointer_,
479            "valueWithPointer:");
480        _NS_PRIVATE_DEF_SEL(wait,
481            "wait");
482        _NS_PRIVATE_DEF_SEL(waitUntilDate_,
483            "waitUntilDate:");
484    } // Class
485} // Private
486} // MTL
487
488//-------------------------------------------------------------------------------------------------------------------------------------------------------------