fix trailing whitespaces and tabulators in the middle of a line
[libfirm] / ir / libcore / lc_config.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  * Central definitions for the libcore.
23  * @author Sebastian Hack
24  * @date 22.12.2004
25  */
26
27 #ifndef _LC_CONFIG_H
28 #define _LC_CONFIG_H
29
30 #if defined(__STD_VERSION__) && __STD_VERSION >= 199901L
31 #define LC_HAVE_C99 1
32 #endif
33
34 /* ISO C99 Standard stuff */
35 #ifdef LC_HAVE_C99
36 #define LC_FUNCNAME    __func__
37 #define LC_UNUSED(x)   x
38 #define LC_LONGLONG    long long
39 #define LC_LONGDOUBLE  long double
40
41 /* definitions using GCC */
42 #elif defined(__GNUC__)
43
44 #define inline         __inline__
45 #define LC_FUNCNAME    __FUNCTION__
46 #define LC_UNUSED(x)   x __attribute__((__unused__))
47
48 #ifdef __STRICT_ANSI__
49 #define LC_LONGLONG    long
50 #define LC_LONGDOUBLE  double
51 #else
52 #define LC_LONGLONG    long long
53 #define LC_LONGDOUBLE  long double
54 #endif
55
56 #elif defined(_MSC_VER)
57
58 #define LC_FUNCNAME    "<unknown>"
59 #define LC_UNUSED(x)   x
60 #define LC_LONGLONG    __int64
61 #define LC_LONGDOUBLE  long double
62
63 /* disable warning: 'foo' was declared deprecated, use 'bla' instead */
64 /* of course MS had to make 'bla' incompatible to 'foo', so a simple */
65 /* define will not work :-((( */
66 #pragma warning( disable : 4996 )
67
68 #ifdef _WIN32
69 #define snprintf _snprintf
70 #endif /* _WIN32 */
71
72 #if _MSC_VER <= 1200
73 typedef __int16         int16;
74 typedef __int32         int32;
75 typedef __int64         int64;
76 typedef unsigned __int16                uint16;
77 typedef unsigned __int32                uint32;
78 typedef unsigned __int64                uint64;
79 #endif /* _MSC_VER <= 1200 */
80
81 /* default definitions */
82 #else /* defined(_MSC_VER) */
83
84 #define inline
85 #define LC_FUNCNAME "<unknown>"
86 #define LC_UNUSED(x)
87 #define LC_LONGLONG long
88 #define LC_LONGDOUBLE double
89
90 #endif
91
92 #endif /* _LC_CONFIG_H */