X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_fixups.h;h=d91e155e501c14212f90f59c456c5faace24d8c5;hb=636019fc5ddd5b1661685ba04968cc220ea117ed;hp=c275076d1479a374fc8ff9b4653ab14ea225f62c;hpb=5ceabdd8d3fa1c4641bb6d35a0f40d4cf4e5b650;p=vlc diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h index c275076d14..d91e155e50 100644 --- a/include/vlc_fixups.h +++ b/include/vlc_fixups.h @@ -1,21 +1,21 @@ /***************************************************************************** - * fixups.h: portability fixups included from config.h + * vlc_fixups.h: portability fixups included from config.h ***************************************************************************** * Copyright © 1998-2008 the VideoLAN project * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ /** @@ -48,7 +48,8 @@ typedef struct # include /* FILE */ #endif -#if !defined (HAVE_STRLCPY) || \ +#if !defined (HAVE_POSIX_MEMALIGN) || \ + !defined (HAVE_STRLCPY) || \ !defined (HAVE_STRNDUP) || \ !defined (HAVE_STRNLEN) # include /* size_t */ @@ -118,6 +119,10 @@ char *strdup (const char *); int strncasecmp (const char *, const char *, size_t); #endif +#ifndef HAVE_STRVERSCMP +int strverscmp (const char *, const char *); +#endif + #ifndef HAVE_STRNLEN size_t strnlen (const char *, size_t); #endif @@ -183,10 +188,7 @@ int fsync (int fd); /* dirent.h */ #ifndef HAVE_DIRFD -#if defined(__APPLE__) || defined(__OS2__) -#undef dirfd -#endif -int dirfd (DIR *); +int (dirfd) (DIR *); #endif #ifndef HAVE_FDOPENDIR @@ -211,6 +213,10 @@ int setenv (const char *, const char *, int); int unsetenv (const char *); #endif +#ifndef HAVE_POSIX_MEMALIGN +int posix_memalign (void **, size_t, size_t); +#endif + /* locale.h */ #ifndef HAVE_USELOCALE #define LC_NUMERIC_MASK 0 @@ -232,6 +238,11 @@ static inline locale_t newlocale(int mask, const char * locale, locale_t base) } #endif +#if !defined (HAVE_STATIC_ASSERT) +# define _Static_assert(x, s) ((void) sizeof (struct { unsigned:-!(x); })) +# define static_assert _Static_assert +#endif + /* Alignment of critical static data structures */ #ifdef ATTRIBUTE_ALIGNED_MAX # define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < align) ? ATTRIBUTE_ALIGNED_MAX : align))) @@ -273,10 +284,8 @@ struct pollfd }; #endif #ifndef HAVE_POLL -# define poll(a, b, c) vlc_poll(a, b, c) -#elif defined (HAVE_MAEMO) -# include -# define poll(a, b, c) vlc_poll(a, b, c) +struct pollfd; +int poll (struct pollfd *, unsigned, int); #endif #ifndef HAVE_IF_NAMEINDEX @@ -329,18 +338,6 @@ long jrand48 (unsigned short subi[3]); long nrand48 (unsigned short subi[3]); #endif -#ifdef __ANDROID__ -# undef __linux__ -# ifndef __cplusplus -# define __cplusplus 0 -# endif -# include -# if __cplusplus == 0 -# undef __cplusplus -# endif -char *tempnam(const char *, const char *); -#endif // ANDROID - #ifdef __OS2__ # undef HAVE_FORK /* Implementation of fork() is imperfect on OS/2 */ #endif