1 /*****************************************************************************
2 * fixups.h: portability fixups included from config.h
3 *****************************************************************************
4 * Copyright © 1998-2007 the VideoLAN project
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.
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.
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 *****************************************************************************/
24 * This file is a collection of portability fixes
27 #ifndef LIBVLC_FIXUPS_H
28 # define LIBVLC_FIXUPS_H 1
31 # define strdup vlc_strdup
34 #ifndef HAVE_VASPRINTF
35 # define vasprintf vlc_vasprintf
39 # define asprintf vlc_asprintf
43 # define strndup vlc_strndup
47 # define strnlen vlc_strnlen
51 # define strlcpy vlc_strlcpy
55 # define atof vlc_atof
60 # define strtof( a, b ) ((float)strtod (a, b))
65 # define atoll vlc_atoll
69 # define strtoll vlc_strtoll
73 # define lldiv vlc_lldiv
77 # define scandir vlc_scandir
78 # define alphasort vlc_alphasort
82 # define getenv vlc_getenv
85 #ifndef HAVE_STRCASECMP
87 # define strcasecmp vlc_strcasecmp
89 # define strcasecmp stricmp
93 #ifndef HAVE_STRNCASECMP
94 # ifndef HAVE_STRNICMP
95 # define strncasecmp vlc_strncasecmp
97 # define strncasecmp strnicmp
101 #ifndef HAVE_STRCASESTR
102 # ifndef HAVE_STRISTR
103 # define strcasestr vlc_strcasestr
105 # define strcasestr stristr
109 #ifndef HAVE_LOCALTIME_R
110 /* If localtime_r() is not provided, we assume localtime() uses
111 * thread-specific storage. */
113 static struct tm *localtime_r (const time_t *timep, struct tm *result)
115 struct tm *s = localtime (timep);
124 #endif /* !LIBVLC_FIXUPS_H */