Design Pattern Examples
Overview of object-oriented design patterns
lusplus/helpers/_countof.h
Go to the documentation of this file.
1#ifndef ___COUNTOF_H__
2#define ___COUNTOF_H__
3
4#include <stdlib.h>
5// On Windows, stdlib.h contains a definition of _countof().
6// On Linux, this definition does not exist so we need to add one.
7#ifndef _countof
8#define _countof(w) (sizeof(w) / sizeof((w)[0]))
9#endif
10
11#endif // ___COUNTOF_H__