Commit 88066e9c authored by Gildas Bazin's avatar Gildas Bazin

* ALL: added vlc_asprintf() to our libc.
parent 34538823
dnl Autoconf settings for vlc
dnl $Id: configure.ac,v 1.147 2004/01/09 15:39:38 hartman Exp $
dnl $Id: configure.ac,v 1.148 2004/01/09 18:32:03 gbazin Exp $
AC_INIT(vlc,0.7.1-cvs)
......@@ -273,7 +273,7 @@ CPPFLAGS_save="${CPPFLAGS_save} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcd
dnl Check for system libs needed
need_libc=false
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 if_nametoindex atoll getenv putenv setenv gmtime_r ctime_r)
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf asprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 if_nametoindex atoll getenv putenv setenv gmtime_r ctime_r)
dnl Check for usual libc functions
AC_CHECK_FUNCS(strdup strndup atof lseek)
......
......@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc_common.h,v 1.100 2004/01/08 11:18:27 fenrir Exp $
* $Id: vlc_common.h,v 1.101 2004/01/09 18:32:03 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -619,6 +619,13 @@ static inline uint64_t GetQWLE( void * _p )
# define vlc_vasprintf NULL
#endif
#if !defined(HAVE_ASPRINTF) || defined(SYS_DARWIN) || defined(SYS_BEOS)
# define asprintf vlc_asprintf
VLC_EXPORT( int, vlc_asprintf, (char **, const char *, ... ) );
#elif !defined(__PLUGIN__)
# define vlc_asprintf NULL
#endif
#ifndef HAVE_STRNDUP
# if defined(STRNDUP_IN_GNOME_H) && \
(defined(MODULE_NAME_IS_gnome)||defined(MODULE_NAME_IS_gnome_main)||\
......
......@@ -2,7 +2,7 @@
* libc.c: Extra libc function for some systems.
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: libc.c,v 1.13 2004/01/08 11:36:40 jlj Exp $
* $Id: libc.c,v 1.14 2004/01/09 18:32:04 gbazin Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Samuel Hocevar <sam@zoy.org>
......@@ -173,6 +173,19 @@ int vlc_vasprintf(char **strp, const char *fmt, va_list ap)
}
#endif
/*****************************************************************************
* asprintf:
*****************************************************************************/
#if !defined(HAVE_ASPRINTF) || defined(SYS_DARWIN) || defined(SYS_BEOS)
int vlc_asprintf( char **strp, const char *fmt, ... )
{
va_list args;
va_start( args, fmt );
vasprintf( strp, fmt, args );
va_end( args );
}
#endif
/*****************************************************************************
* atof: convert a string to a double.
*****************************************************************************/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment