mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +00:00
[XDK] add cpp security checks for RTL_NUMBER_OF_V2/ARRAYSIZE
svn path=/trunk/; revision=69080
This commit is contained in:
parent
4fdcca4b99
commit
b35101db5f
1 changed files with 4 additions and 1 deletions
|
@ -680,8 +680,11 @@ typedef struct _GROUP_AFFINITY {
|
|||
#define RTL_NUMBER_OF_V2(A) \
|
||||
(({ int _check_array_type[__builtin_types_compatible_p(typeof(A), typeof(&A[0])) ? -1 : 1]; (void)_check_array_type; }), \
|
||||
RTL_NUMBER_OF_V1(A))
|
||||
#elif defined(__cplusplus)
|
||||
template <typename T, size_t N>
|
||||
char (& SAFE_RTL_NUMBER_OF(T (&)[N]))[N];
|
||||
#define RTL_NUMBER_OF_V2(A) sizeof(SAFE_RTL_NUMBER_OF(A))
|
||||
#else
|
||||
/// \todo implement security checks for cplusplus / MSVC
|
||||
#define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A)
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue