Skip to content

Commit

Permalink
Fix compiler warning when compling NSFontAssetRequest.m in libs-gui
Browse files Browse the repository at this point in the history
Cast the result type of CALL_NON_NULL_BLOCK to void to satisfy the ? operator.

```
NSFontAssetRequest.m:48:3: error: incompatible operand types ('int' and 'id')
    48 |   CALL_BLOCK(completionHandler, error);
        |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/tools/msys64/ucrt64/include/GNUstepBase/GSBlocks.h:110:53: note: expanded from macro 'CALL_BLOCK'
    110 | #define CALL_BLOCK(block, args...) ((NULL != block) ? CALL_NON_NULL_BLOCK(block, args) : nil)
        |                                                     ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   ~~~
1 error generated.
```
  • Loading branch information
qmfrederik committed Oct 9, 2023
1 parent 531d3b8 commit 6979e8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Headers/GNUstepBase/GSBlocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ typedef retTy(^name)()

#endif /* __has_feature(blocks) */

#define CALL_BLOCK(block, args...) ((NULL != block) ? CALL_NON_NULL_BLOCK(block, args) : nil)
#define CALL_BLOCK_NO_ARGS(block) ((NULL != block) ? CALL_NON_NULL_BLOCK_NO_ARGS(block) : nil)
#define CALL_BLOCK(block, args...) ((NULL != block) ? (void)CALL_NON_NULL_BLOCK(block, args) : nil)
#define CALL_BLOCK_NO_ARGS(block) ((NULL != block) ? (void)CALL_NON_NULL_BLOCK_NO_ARGS(block) : nil)

#if __has_include(<objc/blocks_runtime.h>)
# include <objc/blocks_runtime.h>
Expand Down

0 comments on commit 6979e8e

Please sign in to comment.