1ecce36beSmrg/*
2ecce36beSmrg * Common useful header for xcb-util
3ecce36beSmrg *
4ecce36beSmrg * Copyright © 2009 Julien Danjou <julien@danjou.info>
5ecce36beSmrg *
6ecce36beSmrg * Permission is hereby granted, free of charge, to any person
7ecce36beSmrg * obtaining a copy of this software and associated documentation
8ecce36beSmrg * files (the "Software"), to deal in the Software without
9ecce36beSmrg * restriction, including without limitation the rights to use, copy,
10ecce36beSmrg * modify, merge, publish, distribute, sublicense, and/or sell copies
11ecce36beSmrg * of the Software, and to permit persons to whom the Software is
12ecce36beSmrg * furnished to do so, subject to the following conditions:
13ecce36beSmrg *
14ecce36beSmrg * The above copyright notice and this permission notice shall be
15ecce36beSmrg * included in all copies or substantial portions of the Software.
16ecce36beSmrg *
17ecce36beSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18ecce36beSmrg * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19ecce36beSmrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20ecce36beSmrg * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
21ecce36beSmrg * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
22ecce36beSmrg * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23ecce36beSmrg * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24ecce36beSmrg *
25ecce36beSmrg * Except as contained in this notice, the names of the authors or
26ecce36beSmrg * their institutions shall not be used in advertising or otherwise to
27ecce36beSmrg * promote the sale, use or other dealings in this Software without
28ecce36beSmrg * prior written authorization from the authors.
29ecce36beSmrg *
30ecce36beSmrg */
31ecce36beSmrg
32ecce36beSmrg#ifdef HAVE_SYS_TYPES_H
33ecce36beSmrg# include <sys/types.h>
34ecce36beSmrg#endif
35ecce36beSmrg
36ecce36beSmrg#define ssizeof(foo)            (ssize_t)sizeof(foo)
37ecce36beSmrg#define countof(foo)            (ssizeof(foo) / ssizeof(foo[0]))
38