Dibbler - a portable DHCPv6  1.0.2RC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sysstl.h
Go to the documentation of this file.
1 /*
2  Posadis - A DNS Server
3  Universal include file for string functions, since different OS'ses use different directories
4  Copyright (C) 2001 Meilof Veeningen <meilof@users.sourceforge.net>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20 
21 #ifndef __POSLIB_SYSSTL_H
22 #define __POSLIB_SYSSTL_H
23 
24 #include "dibbler-config.h"
25 
26 #include "sysstring.h"
27 
28 #include <list>
29 
30 #ifdef HAVE_SLIST
31 # include <slist>
32 #else
33 # ifdef HAVE_EXT_SLIST
34 # define HAVE_SLIST
35 # include <ext/slist>
36 # else
37 # define slist std::list
38 # endif
39 #endif
40 
41 #include <string>
42 
43 #ifdef _LEAKCHECK_
44 /* Use malloc_alloc for leak checking
45  *
46  * This code is _very_ platform-specific. I know this not to work on Mandrake
47  * Linux using gcc 3.2, and, iirc, it doesn't work with gcc-2.96 on mdk either.
48  * It does work on my debian box however, so I'll do my leak tests on that
49  * one.
50  */
51 #define stl_string std::basic_string<char, std::string_char_traits<char>, malloc_alloc >
52 #define stl_slist(type) slist <type, malloc_alloc >
53 #define stl_list(type) std::list<type, malloc_alloc >
54 #else
55 #define stl_slist(type) slist <type>
56 #define stl_list(type) std::list<type>
57 #define stl_string std::string
58 #endif
59 
60 #ifdef HAVE_EXT_SLIST
61 using namespace __gnu_cxx;
62 #endif
63 
64 #endif /* __POSLIB_SYSSTL_H */
65