Simplify usage of LC_OPT_ENT_STR(): The length of the buffer is determined in the...
[libfirm] / ir / libcore / lc_defines.h
1 /*
2   libcore: library for basic data structures and algorithms.
3   Copyright (C) 2005  IPD Goos, Universit"at Karlsruhe, Germany
4
5   This library is free software; you can redistribute it and/or
6   modify it under the terms of the GNU Lesser General Public
7   License as published by the Free Software Foundation; either
8   version 2.1 of the License, or (at your option) any later version.
9
10   This library is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13   Lesser General Public License for more details.
14
15   You should have received a copy of the GNU Lesser General Public
16   License along with this library; if not, write to the Free Software
17   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18 */
19
20
21 /**
22  * Some common defines.
23  * @author Sebastian Hack
24  * @date 22.12.2004
25  */
26
27 #ifndef _LIBCORE_DEFINES_H
28 #define _LIBCORE_DEFINES_H
29
30 #define LC_ARRSIZE(x)             (sizeof(x) / sizeof(x[0]))
31
32 #define LC_MIN(x,y)               ((x) < (y) ? (x) : (y))
33 #define LC_MAX(x,y)               ((x) > (y) ? (x) : (y))
34
35 /** define a readable fourcc code */
36 #define LC_FOURCC(a,b,c,d)        ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))
37 #define LC_FOURCC_STR(str)        LC_FOURCC(str[0], str[1], str[2], str[3])
38
39 #endif