mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2024-12-02 22:36:16 +08:00
[freerdp,api] log NULL IFCALL/IFCALLRET calls
This commit is contained in:
parent
8877614d50
commit
22fffdd5ea
@ -21,6 +21,7 @@
|
||||
#define FREERDP_API_H
|
||||
|
||||
#include <winpr/winpr.h>
|
||||
#include <winpr/wlog.h>
|
||||
#include <winpr/platform.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
@ -65,24 +66,34 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define IFCALL(_cb, ...) \
|
||||
do \
|
||||
{ \
|
||||
if (_cb != NULL) \
|
||||
{ \
|
||||
_cb(__VA_ARGS__); \
|
||||
} \
|
||||
#define IFCALL(_cb, ...) \
|
||||
do \
|
||||
{ \
|
||||
if (_cb != NULL) \
|
||||
_cb(__VA_ARGS__); \
|
||||
else \
|
||||
WLog_VRB("com.freerdp.api", "IFCALL(" #_cb ") == NULL"); \
|
||||
} while (0)
|
||||
#define IFCALLRET(_cb, _ret, ...) \
|
||||
do \
|
||||
{ \
|
||||
if (_cb != NULL) \
|
||||
{ \
|
||||
_ret = _cb(__VA_ARGS__); \
|
||||
} \
|
||||
#define IFCALLRET(_cb, _ret, ...) \
|
||||
do \
|
||||
{ \
|
||||
if (_cb != NULL) \
|
||||
_ret = _cb(__VA_ARGS__); \
|
||||
else \
|
||||
WLog_VRB("com.freerdp.api", "IFCALLRET(" #_cb ") == NULL"); \
|
||||
} while (0)
|
||||
#define IFCALLRESULT(_default_return, _cb, ...) \
|
||||
((_cb != NULL) ? _cb(__VA_ARGS__) : (_default_return))
|
||||
|
||||
#if __GNUC__
|
||||
#define IFCALLRESULT(_default_return, _cb, ...) \
|
||||
({ \
|
||||
(_cb != NULL) ? _cb(__VA_ARGS__) : ({ \
|
||||
WLog_VRB("com.freerdp.api", "IFCALLRESULT(" #_cb ") == NULL"); \
|
||||
(_default_return); \
|
||||
}); \
|
||||
})
|
||||
#else
|
||||
#define IFCALLRESULT(_default_return, _cb, ...) (_cb != NULL) ? _cb(__VA_ARGS__) : (_default_return)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define ALIGN64 __attribute__((aligned(8)))
|
||||
|
@ -3286,10 +3286,7 @@ BOOL update_begin_paint(rdpUpdate* update)
|
||||
WINPR_ASSERT(update);
|
||||
rdp_update_lock(update);
|
||||
|
||||
if (!update->BeginPaint)
|
||||
return TRUE;
|
||||
|
||||
return update->BeginPaint(update->context);
|
||||
return IFCALLRESULT(TRUE, update->BeginPaint, update->context);
|
||||
}
|
||||
|
||||
BOOL update_end_paint(rdpUpdate* update)
|
||||
@ -3299,8 +3296,7 @@ BOOL update_end_paint(rdpUpdate* update)
|
||||
if (!update)
|
||||
return FALSE;
|
||||
|
||||
if (update->EndPaint)
|
||||
rc = update->EndPaint(update->context);
|
||||
IFCALLRET(update->EndPaint, rc, update->context);
|
||||
|
||||
rdp_update_unlock(update);
|
||||
return rc;
|
||||
|
Loading…
Reference in New Issue
Block a user