diff --git a/winpr/include/winpr/winpr.h b/winpr/include/winpr/winpr.h index 49c285c04..126f8e1e3 100644 --- a/winpr/include/winpr/winpr.h +++ b/winpr/include/winpr/winpr.h @@ -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; \ }) /**