Skip to content

Commit 122c34d

Browse files
Added PFVoid macro for tasks that yield no usable result.
1 parent 9181b03 commit 122c34d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Parse/Internal/PFMacros.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,16 @@ __strong __typeof__(var) var = var ## _weak;
122122
}) \
123123
)
124124

125+
/*!
126+
This exists to use along with bolts generic tasks. Instead of returning a BFTask with no generic type, or a generic
127+
type of 'NSNull' when there is no usable result from a task, we use the type 'PFVoid', which will always have a value
128+
of 'nil'.
129+
130+
This allows us to more easily descern between methods that have not yet updated the return type of their tasks, as well
131+
as provide a more enforced API contract to the caller (as sending any message to PFVoid will result in a compile time
132+
error).
133+
*/
134+
@class _PFVoid_Nonexistant;
135+
typedef _PFVoid_Nonexistant *PFVoid;
136+
125137
#endif

0 commit comments

Comments
 (0)