Changeset 47756a76e28ebd414ad5c33963b356e55774ef19

Show
Ignore:
Timestamp:
01/27/08 17:31:12 (7 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1201451472 +0000
git-parent:

[e6fc3cac4bd65c97fc07a5245ab8595803e8cc37]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1201451472 +0000
Message:

Fix another series of HAVE_ dependencies (string replacement functions mostly).
Now vlc/vlc.h can be included out of the box.
However, I believe it will only work properly on little-endian 32-bits platforms.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • configure.ac

    r7fd77d9 r47756a7  
    471471need_libc=false 
    472472 
    473 AC_CHECK_FUNCS(gettimeofday strtod strtol strtof strtoll strtoull strsep isatty vasprintf asprintf swab sigrelse getpwuid memalign posix_memalign if_nametoindex atoll getenv putenv setenv gmtime_r ctime_r localtime_r lrintf daemon scandir fork bsearch lstat strlcpy) 
    474  
    475473dnl Check for usual libc functions 
    476 AC_CHECK_FUNCS(strdup strndup strnlen atof
     474AC_CHECK_FUNCS([gettimeofday strtod strtol strtof strtoll strtoull strsep isatty vasprintf asprintf swab sigrelse getpwuid memalign posix_memalign if_nametoindex atoll getenv putenv setenv gmtime_r ctime_r localtime_r lrintf daemon scandir fork bsearch lstat strlcpy strdup strndup strnlen atof lldiv]
    477475AC_CHECK_FUNCS(strcasecmp,,[AC_CHECK_FUNCS(stricmp)]) 
    478476AC_CHECK_FUNCS(strncasecmp,,[AC_CHECK_FUNCS(strnicmp)]) 
    479477AC_CHECK_FUNCS(strcasestr,,[AC_CHECK_FUNCS(stristr)]) 
     478 
     479AH_BOTTOM([#include <vlc_fixups.h>]) 
    480480 
    481481AS_IF([test "${SYS}" = "linux"], [ 
  • include/vlc_common.h

    re6fc3ca r47756a7  
    817817 
    818818/* Stuff defined in src/extras/libc.c */ 
    819 #ifndef HAVE_STRDUP 
    820 #   define strdup vlc_strdup 
    821     VLC_EXPORT( char *, vlc_strdup, ( const char *s ) ); 
    822 #endif 
    823  
    824 #if !defined(HAVE_VASPRINTF) || defined(__APPLE__) || defined(SYS_BEOS) 
    825 #   define vasprintf vlc_vasprintf 
    826     VLC_EXPORT( int, vlc_vasprintf, (char **, const char *, va_list ) ); 
    827 #endif 
    828  
    829 #if !defined(HAVE_ASPRINTF) || defined(__APPLE__) || defined(SYS_BEOS) 
    830 #   define asprintf vlc_asprintf 
    831     VLC_EXPORT( int, vlc_asprintf, (char **, const char *, ... ) ATTRIBUTE_FORMAT( 2, 3 ) ); 
    832 #endif 
    833  
    834 #ifndef HAVE_STRNDUP 
    835 #   if defined(STRNDUP_IN_GNOME_H) && \ 
    836         (defined(MODULE_NAME_IS_gnome)||defined(MODULE_NAME_IS_gnome_main)||\ 
    837          defined(MODULE_NAME_IS_gnome2)||defined(MODULE_NAME_IS_gnome2_main)) 
    838         /* Do nothing: gnome.h defines strndup for us */ 
    839 #   else 
    840 #       define strndup vlc_strndup 
    841         VLC_EXPORT( char *, vlc_strndup, ( const char *s, size_t n ) ); 
    842 #   endif 
    843 #endif 
    844  
    845 #ifndef HAVE_STRLCPY 
    846 #   define strlcpy vlc_strlcpy 
    847     VLC_EXPORT( size_t, vlc_strlcpy, ( char *, const char *, size_t ) ); 
    848 #endif 
    849  
    850 #ifndef HAVE_ATOF 
    851 #   define atof vlc_atof 
    852     VLC_EXPORT( double, vlc_atof, ( const char *nptr ) ); 
    853 #endif 
    854  
    855 #ifndef HAVE_STRTOF 
    856 #   ifdef HAVE_STRTOD 
    857 #       define strtof strtod 
    858 #   endif 
    859 #endif 
    860  
    861 #ifndef HAVE_ATOLL 
    862 #   define atoll vlc_atoll 
    863     VLC_EXPORT( int64_t, vlc_atoll, ( const char *nptr ) ); 
    864 #endif 
    865  
    866 #ifndef HAVE_STRTOLL 
    867 #   define strtoll vlc_strtoll 
    868     VLC_EXPORT( int64_t, vlc_strtoll, ( const char *nptr, char **endptr, int base ) ); 
    869 #endif 
     819VLC_EXPORT( char *, vlc_strdup, ( const char *s ) ); 
     820VLC_EXPORT( int, vlc_vasprintf, (char **, const char *, va_list ) ); 
     821VLC_EXPORT( int, vlc_asprintf, (char **, const char *, ... ) ATTRIBUTE_FORMAT( 2, 3 ) ); 
     822VLC_EXPORT( char *, vlc_strndup, ( const char *s, size_t n ) ); 
     823VLC_EXPORT( size_t, vlc_strlcpy, ( char *, const char *, size_t ) ); 
     824VLC_EXPORT( double, vlc_atof, ( const char *nptr ) ); 
     825VLC_EXPORT( int64_t, vlc_atoll, ( const char *nptr ) ); 
     826VLC_EXPORT( int64_t, vlc_strtoll, ( const char *nptr, char **endptr, int base ) ); 
    870827 
    871828#if defined(SYS_BEOS) \ 
     
    875832        long long rem;  /* Remainder. */ 
    876833    } lldiv_t; 
    877 #   define lldiv vlc_lldiv 
    878     VLC_EXPORT( lldiv_t, vlc_lldiv, ( long long numer, long long denom ) ); 
    879 #endif 
    880  
    881 #ifndef HAVE_SCANDIR 
    882 #   define scandir vlc_scandir 
    883 #   define alphasort vlc_alphasort 
    884     struct dirent; 
    885     VLC_EXPORT( int, vlc_scandir, ( const char *name, struct dirent ***namelist, int (*filter) ( const struct dirent * ), int (*compar) ( const struct dirent **, const struct dirent ** ) ) ); 
    886     VLC_EXPORT( int, vlc_alphasort, ( const struct dirent **a, const struct dirent **b ) ); 
    887 #endif 
    888  
    889 #ifndef HAVE_GETENV 
    890 #   define getenv vlc_getenv 
    891     VLC_EXPORT( char *, vlc_getenv, ( const char *name ) ); 
    892 #endif 
    893  
    894 #ifndef HAVE_STRCASECMP 
    895 #   ifndef HAVE_STRICMP 
    896 #       define strcasecmp vlc_strcasecmp 
    897         VLC_EXPORT( int, vlc_strcasecmp, ( const char *s1, const char *s2 ) ); 
    898 #   else 
    899 #       define strcasecmp stricmp 
    900 #   endif 
    901 #endif 
    902  
    903 #ifndef HAVE_STRNCASECMP 
    904 #   ifndef HAVE_STRNICMP 
    905 #       define strncasecmp vlc_strncasecmp 
    906         VLC_EXPORT( int, vlc_strncasecmp, ( const char *s1, const char *s2, size_t n ) ); 
    907 #   else 
    908 #       define strncasecmp strnicmp 
    909 #   endif 
    910 #endif 
    911  
    912 #ifndef HAVE_STRCASESTR 
    913 #   ifndef HAVE_STRISTR 
    914 #       define strcasestr vlc_strcasestr 
    915         VLC_EXPORT( char *, vlc_strcasestr, ( const char *s1, const char *s2 ) ); 
    916 #   else 
    917 #       define strcasestr stristr 
    918 #   endif 
    919 #endif 
     834#endif 
     835VLC_EXPORT( lldiv_t, vlc_lldiv, ( long long numer, long long denom ) ); 
     836 
     837struct dirent; 
     838VLC_EXPORT( int, vlc_scandir, ( const char *name, struct dirent ***namelist, int (*filter) ( const struct dirent * ), int (*compar) ( const struct dirent **, const struct dirent ** ) ) ); 
     839VLC_EXPORT( int, vlc_alphasort, ( const struct dirent **a, const struct dirent **b ) ); 
     840 
     841VLC_EXPORT( char *, vlc_getenv, ( const char *name ) ); 
     842 
     843VLC_EXPORT( int, vlc_strcasecmp, ( const char *s1, const char *s2 ) ); 
     844VLC_EXPORT( int, vlc_strncasecmp, ( const char *s1, const char *s2, size_t n ) ); 
     845VLC_EXPORT( char *, vlc_strcasestr, ( const char *s1, const char *s2 ) ); 
    920846 
    921847#ifndef HAVE_DIRENT_H 
  • src/extras/libc.c

    r99fab90 r47756a7  
    376376 * lldiv: returns quotient and remainder 
    377377 *****************************************************************************/ 
    378 #if defined(SYS_BEOS) \ 
    379  || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) 
     378#if !defined( HAVE_LLDIV ) 
    380379lldiv_t vlc_lldiv( long long numer, long long denom ) 
    381380{ 
  • src/test/headers.c

    r42b03d1 r47756a7  
    2525 * e.g. using pkg-config or the broken old vlc-config. */ 
    2626 
     27#define PACKAGE "vlc" 
     28 
    2729#include <vlc/vlc.h> 
    2830#include <vlc/libvlc.h>