]> git.sesse.net Git - vlc/blob - include/vlc_fixups.h
Fix another series of HAVE_ dependencies (string replacement functions mostly).
[vlc] / include / vlc_fixups.h
1 /*****************************************************************************
2  * fixups.h: portability fixups included from config.h
3  *****************************************************************************
4  * Copyright © 1998-2007 the VideoLAN project
5  * $Id$
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
20  *****************************************************************************/
21
22 /**
23  * \file
24  * This file is a collection of portability fixes
25  */
26
27 #ifndef HAVE_STRDUP
28 # define strdup vlc_strdup
29 #endif
30
31 #ifndef HAVE_VASPRINTF
32 # define vasprintf vlc_vasprintf
33 #endif
34
35 #ifndef HAVE_ASPRINTF
36 # define asprintf vlc_asprintf
37 #endif
38
39 #ifndef HAVE_STRNDUP
40 # define strndup vlc_strndup
41 #endif
42
43 #ifndef HAVE_STRLCPY
44 # define strlcpy vlc_strlcpy
45 #endif
46
47 #ifndef HAVE_ATOF
48 # define atof vlc_atof
49 #endif
50
51 #ifndef HAVE_STRTOF
52 # ifdef HAVE_STRTOD
53 #  define strtof( a, b ) ((float)strtod (a, b))
54 # endif
55 #endif
56
57 #ifndef HAVE_ATOLL
58 # define atoll vlc_atoll
59 #endif
60
61 #ifndef HAVE_STRTOLL
62 # define strtoll vlc_strtoll
63 #endif
64
65 #ifndef HAVE_LLDIV
66 # define lldiv vlc_lldiv
67 #endif
68
69 #ifndef HAVE_SCANDIR
70 # define scandir vlc_scandir
71 # define alphasort vlc_alphasort
72 #endif
73
74 #ifndef HAVE_GETENV
75 # define getenv vlc_getenv
76 #endif
77
78 #ifndef HAVE_STRCASECMP
79 # ifndef HAVE_STRICMP
80 #  define strcasecmp vlc_strcasecmp
81 # else
82 #  define strcasecmp stricmp
83 # endif
84 #endif
85
86 #ifndef HAVE_STRNCASECMP
87 # ifndef HAVE_STRNICMP
88 #  define strncasecmp vlc_strncasecmp
89 # else
90 #  define strncasecmp strnicmp
91 # endif
92 #endif
93
94 #ifndef HAVE_STRCASESTR
95 # ifndef HAVE_STRISTR
96 #  define strcasestr vlc_strcasestr
97 # else
98 #  define strcasestr stristr
99 # endif
100 #endif
101