33617f4be7a5f401b21992f755c19cde93793e95
[libfirm] / ir / libcore / lc_common_t.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 #ifndef _COMMON_T_H
21 #define _COMMON_T_H
22
23 #include <obstack.h>
24 #include <stdarg.h>
25 #include <stdio.h>
26
27 #define obstack_chunk_alloc malloc
28 #define obstack_chunk_free free
29
30 #define bcopy(src,dest,n) memcpy(dest,src,n)
31
32 #include "lc_config.h"
33
34 #define FUNCNAME     LC_FUNCNAME
35 #define UNUSED(x)    LC_UNUSED(x)
36 #define LONGLONG     long /* LC_LONGLONG */
37 #define LONGDOUBLE   double /* LC_LONGDOUBLE */
38
39 #ifdef LC_HAVE_C99
40 #define HAVE_C99     LC_HAVE_C99
41 #else /* LC_HAVE_C99 */
42
43 #ifdef _WIN32
44 /* Windows names for non-POSIX calls */
45 #define snprintf  _snprintf
46 #define vsnprintf _vsnprintf
47 #endif /* WIN32 */
48
49 /* These both are not posix or ansi c but almost everywhere existent */
50
51 /* Daniel: Why not just include stdio.h?
52 extern int snprintf(char *buf, size_t size, const char *fmt, ...);
53 extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
54 */
55
56 #endif /* LC_HAVE_C99 */
57
58 #endif /* _COMMON_T_H */