git.s-ol.nu forks/DiligentCore / ba54ff5
Fixed few C issues in platform definitions assiduous 3 years ago
3 changed file(s) with 30 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
2222
2323 #pragma once
2424
25 #include <cstddef>
25 #if DILIGENT_C_INTERFACE
26
27 # define _countof(arr) (sizeof(arr) / sizeof(arr[0]))
28
29 #else
30
31 # include <cstddef>
2632
2733 template <typename _CountofType, std::size_t _SizeOfArray>
2834 char (*__countof_helper(_CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray];
29 #define _countof(_Array) (sizeof(*__countof_helper(_Array)) + 0)
35 # define _countof(_Array) (sizeof(*__countof_helper(_Array)) + 0)
36
37 #endif
2222
2323 #pragma once
2424
25 #include <cstddef>
25 #if DILIGENT_C_INTERFACE
26
27 # define _countof(arr) (sizeof(arr) / sizeof(arr[0]))
28
29 #else
30
31 # include <cstddef>
2632
2733 template <typename _CountofType, std::size_t _SizeOfArray>
2834 char (*__countof_helper(_CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray];
29 #define _countof(_Array) (sizeof(*__countof_helper(_Array)) + 0)
35 # define _countof(_Array) (sizeof(*__countof_helper(_Array)) + 0)
36
37 #endif
2222
2323 #pragma once
2424
25 #include <cstddef>
25 #if DILIGENT_C_INTERFACE
26
27 # define _countof(arr) (sizeof(arr) / sizeof(arr[0]))
28
29 #else
30
31 # include <cstddef>
2632
2733 template <typename _CountofType, std::size_t _SizeOfArray>
2834 char (*__countof_helper(_CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray];
29 #define _countof(_Array) (sizeof(*__countof_helper(_Array)) + 0)
35 # define _countof(_Array) (sizeof(*__countof_helper(_Array)) + 0)
36
37 #endif