mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[winpr,winpr.h] static assert WINPR_REINTERPRET_CAST
This commit is contained in:
@@ -145,15 +145,16 @@ WINPR_API const char* winpr_get_build_config(void);
|
||||
* @return The casted pointer
|
||||
* @since version 3.9.0
|
||||
*/
|
||||
#define WINPR_REINTERPRET_CAST(ptr, srcType, dstType) \
|
||||
__extension__({ \
|
||||
union \
|
||||
{ \
|
||||
srcType src; \
|
||||
dstType dst; \
|
||||
} cnv; \
|
||||
cnv.src = ptr; \
|
||||
cnv.dst; \
|
||||
#define WINPR_REINTERPRET_CAST(ptr, srcType, dstType) \
|
||||
__extension__({ \
|
||||
union \
|
||||
{ \
|
||||
srcType src; \
|
||||
dstType dst; \
|
||||
} cnv; \
|
||||
WINPR_STATIC_ASSERT(sizeof(srcType) == sizeof(dstType)); \
|
||||
cnv.src = ptr; \
|
||||
cnv.dst; \
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user