jitterbug/try.h

6 lines
417 B
C
Raw Normal View History

2022-12-25 20:54:10 +02:00
#define TRYPTR_NIL(M_expr) ({ void* _result = (void*)(M_expr); if (!_result) { return (NULL); } _result; })
#define TRYPTR(M_expr) ({ void* _result = (void*)(M_expr); if (!_result) { return (-1); } _result; })
#define TRYST_NIL(M_expr) ({ int _result = (int)(M_expr); if (_result < 0) { return (NULL); } _result; })
#define TRYST(M_expr) ({ int _result = (int)(M_expr); if (_result < 0) { return (-1); } _result; })