11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
-
-
|
* Public License, either version 2 or 3, which can be found in the file
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#import "OFObject.h"
#import "block.h"
OF_ASSUME_NONNULL_BEGIN
/**
* @class OFBlock OFBlock.h ObjFW/OFBlock.h
*
* @brief The class for all blocks, since all blocks are also objects.
*/
|
36
37
38
39
40
41
42
43
44
|
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
OF_SUBCLASSING_RESTRICTED
@interface OFGlobalBlock: OFBlock
@end
OF_SUBCLASSING_RESTRICTED
@interface OFMallocBlock: OFBlock
@end
#ifdef __cplusplus
extern "C" {
#endif
extern void *_Block_copy(const void *);
extern void _Block_release(const void *);
# if defined(OF_WINDOWS) && \
(defined(OF_NO_SHARED) || defined(OF_COMPILING_OBJFW))
/*
* Clang has implicit declarations for these, but they are dllimport. When
* compiling ObjFW itself or using it as a static library, these need to be
* dllexport. Interestingly, this still works when using it as a shared library.
*/
extern __declspec(dllexport) struct objc_class _NSConcreteStackBlock;
extern __declspec(dllexport) struct objc_class _NSConcreteGlobalBlock;
extern __declspec(dllexport) void _Block_object_assign(void *, const void *,
const int);
extern __declspec(dllexport) void _Block_object_dispose(const void *,
const int);
# endif
#ifdef __cplusplus
}
#endif
#ifndef Block_copy
# define Block_copy(...) \
((__typeof__(__VA_ARGS__))_Block_copy((const void *)(__VA_ARGS__)))
#endif
#ifndef Block_release
# define Block_release(...) _Block_release((const void *)(__VA_ARGS__))
#endif
OF_ASSUME_NONNULL_END
|