27 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
27 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
28 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ |
29 */ |
30 |
30 |
31 #pragma once |
31 #pragma once |
|
32 #include <stdlib.h> |
|
33 |
32 #if !defined(_MSC_VER) && !defined(__cdecl) |
34 #if !defined(_MSC_VER) && !defined(__cdecl) |
33 # define __cdecl |
35 # define __cdecl |
34 #endif |
36 #endif |
35 |
37 |
36 #define MACRO_TO_STRING_2(A) #A |
38 #define MACRO_TO_STRING_2(A) #A |
86 T clamp (T a, T b, T c) |
88 T clamp (T a, T b, T c) |
87 { |
89 { |
88 return (a < b) ? b : (a > c) ? c : a; |
90 return (a < b) ? b : (a > c) ? c : a; |
89 } |
91 } |
90 |
92 |
|
93 template <typename T, size_t N> |
|
94 char (&_ArraySizeHelper(T (&array)[N]))[N]; |
|
95 #define countof(array) (sizeof(_ArraySizeHelper( array ))) |
|
96 |
91 struct Exitception {}; |
97 struct Exitception {}; |
92 |
98 |
93 END_ZFC_NAMESPACE |
99 END_ZFC_NAMESPACE |