VLC 4.0.0-dev
Loading...
Searching...
No Matches
vlc_fixups.h
Go to the documentation of this file.
1/*****************************************************************************
2 * vlc_fixups.h: portability fixups included from config.h
3 *****************************************************************************
4 * Copyright © 1998-2008 the VideoLAN project
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19 *****************************************************************************/
20
21/**
22 * \file
23 * This file is a collection of portability fixes
24 */
25
26#ifndef LIBVLC_FIXUPS_H
27# define LIBVLC_FIXUPS_H 1
28
29#if defined(_MSC_VER)
30// disable common warnings when compiling POSIX code
31#ifndef _CRT_NONSTDC_NO_DEPRECATE
32// the POSIX variants are not available in the GDK
33# if !(defined(_GAMING_XBOX_SCARLETT) || defined(_GAMING_XBOX_XBOXONE) || defined(_XBOX_ONE))
34# define _CRT_NONSTDC_NO_DEPRECATE
35# endif
36#endif
37#ifndef _CRT_SECURE_NO_WARNINGS
38#define _CRT_SECURE_NO_WARNINGS 1
39#endif
40#if defined(_GAMING_XBOX_SCARLETT) || defined(_GAMING_XBOX_XBOXONE) || defined(_XBOX_ONE)
41// make sure we don't use MS POSIX aliases that won't link
42# undef _CRT_DECLARE_NONSTDC_NAMES
43# define _CRT_DECLARE_NONSTDC_NAMES 0
44#endif
45
46
47// sys/stat.h values
48#define S_IWUSR _S_IWRITE
49#define S_IRUSR _S_IREAD
50#define S_IFIFO _S_IFIFO
51#define S_IFMT _S_IFMT
52#define S_IFCHR _S_IFCHR
53#define S_IFREG _S_IFREG
54#define S_IFDIR _S_IFDIR
55#define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
56#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
57#define S_ISBLK(m) (0)
58
59// same type as statXXX structures st_mode field
60typedef unsigned short mode_t;
61
62// no compat, but there's an MSVC equivalent
63#define strncasecmp _strnicmp
64#define snwprintf _snwprintf
65
66// since we define restrist as __restrict for C++, __declspec(restrict) is bogus
67#define _CRT_SUPPRESS_RESTRICT
68#define DECLSPEC_RESTRICT
69
70// turn CPU MSVC-ism into more standard defines
71#if defined(_M_X64) && !defined(__x86_64__)
72# define __x86_64__
73#endif
74#if defined(_M_IX86) && !defined(__i386__)
75# define __i386__
76#endif
77#if defined(_M_ARM64) && !defined(__aarch64__)
78# define __aarch64__
79#endif
80#if defined(_M_ARM) && !defined(__arm__)
81# define __arm__
82#endif
83#if defined(_M_IX86_FP) && _M_IX86_FP == 1 && !defined(__SSE__)
84# define __SSE__
85#endif
86#if defined(_M_IX86_FP) && _M_IX86_FP == 2 && !defined(__SSE2__)
87# define __SSE2__
88#endif
89
90#endif // _MSC_VER
91
92#ifdef _WIN32
93# if !defined(NOMINMAX)
94// avoid collision between numeric_limits::max() and max define
95# define NOMINMAX
96# endif
97# if !defined(_USE_MATH_DEFINES)
98// enable M_PI definition
99# define _USE_MATH_DEFINES
100# endif
101#endif
102
103
104/* needed to detect uClibc */
105#ifdef HAVE_FEATURES_H
106#include <features.h>
107#endif
108
109/* C++11 says there's no need to define __STDC_*_MACROS when including
110 * inttypes.h and stdint.h. */
111#if defined (__cplusplus) && defined(__UCLIBC__)
112# ifndef __STDC_FORMAT_MACROS
113# define __STDC_FORMAT_MACROS 1
114# endif
115# ifndef __STDC_CONSTANT_MACROS
116# define __STDC_CONSTANT_MACROS 1
117# endif
118# ifndef __STDC_LIMIT_MACROS
119# define __STDC_LIMIT_MACROS 1
120# endif
121#endif
122
123#ifndef __cplusplus
124# ifdef HAVE_THREADS_H
125# include <threads.h>
126# elif !defined(thread_local)
127# ifdef HAVE_THREAD_LOCAL
128# define thread_local _Thread_local
129# elif defined(_MSC_VER)
130# define thread_local __declspec(thread)
131# endif
132# endif
133#endif
134
135#if !defined (HAVE_GMTIME_R) || !defined (HAVE_LOCALTIME_R) \
136 || !defined (HAVE_TIMEGM)
137# include <time.h> /* time_t */
138#endif
139
140#ifndef HAVE_LLDIV
141typedef struct
143 long long quot; /* Quotient. */
144 long long rem; /* Remainder. */
146#endif
147
148#if !defined(HAVE_GETENV) || \
149 !defined(HAVE_USELOCALE)
150# include <stddef.h> /* NULL */
151#endif
152
153#if !defined (HAVE_REWIND) || \
154 !defined (HAVE_GETDELIM)
155# include <stdio.h> /* FILE */
156#endif
157
158#if !defined (HAVE_ALIGNED_ALLOC) || \
159 !defined (HAVE_MEMRCHR) || \
160 !defined (HAVE_POSIX_MEMALIGN) || \
161 !defined (HAVE_QSORT_R) || \
162 !defined (HAVE_STRLCPY) || \
163 !defined (HAVE_STRNDUP) || \
164 !defined (HAVE_STRNLEN) || \
165 !defined (HAVE_STRNSTR)
166# include <stddef.h> /* size_t */
167#endif
168
169#ifndef HAVE_VASPRINTF
170# include <stdarg.h> /* va_list */
171#endif
172
173#if !defined (HAVE_GETDELIM) || \
174 !defined (HAVE_GETPID) || \
175 !defined (HAVE_SWAB) || \
176 !defined (HAVE_WRITEV) || \
177 !defined (HAVE_READV)
178# include <sys/types.h> /* ssize_t, pid_t */
179
180# if defined(_CRT_INTERNAL_NONSTDC_NAMES) && !_CRT_INTERNAL_NONSTDC_NAMES
181// MS POSIX aliases missing
182typedef _off_t off_t;
183# endif
184#endif
185
186#if !defined (HAVE_DIRFD) || \
187 !defined (HAVE_FDOPENDIR)
188# include <dirent.h>
189#endif
190
191#ifdef __cplusplus
192# define VLC_NOTHROW throw ()
193extern "C" {
194#else
195# define VLC_NOTHROW
196#endif
197
198/* stddef.h */
199#if !defined (__cplusplus) && !defined (HAVE_MAX_ALIGN_T)
200typedef struct {
201 long long ll;
202 long double ld;
204#endif
205
206/* stdio.h */
207#ifndef HAVE_ASPRINTF
208int asprintf (char **, const char *, ...);
209#endif
210
211#ifndef HAVE_FLOCKFILE
212void flockfile (FILE *);
213void funlockfile (FILE *);
214int getc_unlocked (FILE *);
216int putc_unlocked (int, FILE *);
218#endif
219
220#ifndef HAVE_GETDELIM
221ssize_t getdelim (char **, size_t *, int, FILE *);
222ssize_t getline (char **, size_t *, FILE *);
223#endif
224
225#ifndef HAVE_REWIND
226void rewind (FILE *);
227#endif
228
229#ifndef HAVE_VASPRINTF
230int vasprintf (char **, const char *, va_list);
231#endif
232
233/* string.h */
234#ifndef HAVE_MEMRCHR
235void *memrchr(const void *, int, size_t);
236#endif
237
238#ifndef HAVE_STRCASECMP
239int strcasecmp (const char *, const char *);
240#endif
241
242#ifndef HAVE_STRCASESTR
243char *strcasestr (const char *, const char *);
244#endif
245
246#ifndef HAVE_STRDUP
247char *strdup (const char *);
248#endif
249
250#ifndef HAVE_STRVERSCMP
251int strverscmp (const char *, const char *);
252#endif
253
254#ifndef HAVE_STRNLEN
255size_t strnlen (const char *, size_t);
256#endif
257
258#ifndef HAVE_STRNSTR
259char * strnstr (const char *, const char *, size_t);
260#endif
261
262#ifndef HAVE_STRNDUP
263char *strndup (const char *, size_t);
264#endif
265
266#ifndef HAVE_STRLCPY
267size_t strlcpy (char *, const char *, size_t);
268#endif
269
270#ifndef HAVE_STRSEP
271char *strsep (char **, const char *);
272#endif
273
274#ifndef HAVE_STRTOK_R
275char *strtok_r(char *, const char *, char **);
276#endif
277
278/* stdlib.h */
279#ifndef HAVE_ATOF
280#ifndef __ANDROID__
281double atof (const char *);
282#endif
283#endif
284
285#ifndef HAVE_ATOLL
286long long atoll (const char *);
287#endif
288
289#ifndef HAVE_LLDIV
290lldiv_t lldiv (long long, long long);
291#endif
292
293#ifndef HAVE_STRTOF
294#ifndef __ANDROID__
295float strtof (const char *, char **);
296#endif
297#endif
298
299#ifndef HAVE_STRTOLL
300long long int strtoll (const char *, char **, int);
301#endif
302
303/* sys/uio.h */
304#ifndef HAVE_READV
305struct iovec;
306ssize_t readv(int, const struct iovec *, int);
307#endif
308
309#ifndef HAVE_WRITEV
310struct iovec;
311ssize_t writev(int, const struct iovec *, int);
312#endif
313
314/* time.h */
315#ifndef HAVE_GMTIME_R
316struct tm *gmtime_r (const time_t *, struct tm *);
317#endif
318
319#ifndef HAVE_LOCALTIME_R
320struct tm *localtime_r (const time_t *, struct tm *);
321#endif
322
323#ifndef HAVE_TIMEGM
324time_t timegm(struct tm *);
325#endif
326
327#ifndef HAVE_TIMESPEC_GET
328#ifndef TIME_UTC
329#define TIME_UTC 1
330#endif
331struct timespec;
332int timespec_get(struct timespec *, int);
333#endif
334
335/* sys/time.h */
336#if defined(WIN32) && !defined(WINSTORECOMPAT) && defined(HAVE_GETPID)
337#include <winapifamily.h>
338#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
339// getpid is incorrectly detected in UWP so we won't use the compat version
340#include <processthreadsapi.h>
341#define getpid() GetCurrentProcessId()
342#endif
343#endif
344
345/* unistd.h */
346#ifndef HAVE_GETPID
347pid_t getpid (void) VLC_NOTHROW;
348#endif
349
350#ifndef HAVE_FSYNC
351int fsync (int fd);
352#endif
353
354/* dirent.h */
355#ifndef HAVE_DIRFD
356int (dirfd) (DIR *);
357#endif
358
359#ifndef HAVE_FDOPENDIR
360DIR *fdopendir (int);
361#endif
362
363#ifdef __cplusplus
364} /* extern "C" */
365#endif
366
367/* stdlib.h */
368#ifndef HAVE_GETENV
369static inline char *getenv (const char *name)
371 (void)name;
372 return NULL;
373}
374#endif
375
376#ifdef __cplusplus
377extern "C" {
378#endif
379
380#ifndef HAVE_SETENV
381int setenv (const char *, const char *, int);
382int unsetenv (const char *);
383#endif
384
385#ifndef HAVE_POSIX_MEMALIGN
386int posix_memalign(void **, size_t, size_t);
387#endif
388
389#ifndef HAVE_ALIGNED_ALLOC
390void *aligned_alloc(size_t, size_t);
391#endif
392
393#ifdef __cplusplus
394} /* extern "C" */
395#endif
396
397#if defined (_WIN32)
398#define aligned_free(ptr) _aligned_free(ptr)
399#else
400#define aligned_free(ptr) free(ptr)
401#endif
402
403#if !defined(HAVE_NEWLOCALE) && defined(HAVE_CXX_LOCALE_T) && defined(__cplusplus)
404# include <locale>
405# define HAVE_NEWLOCALE
406#endif
407
408/* locale.h */
409#ifndef HAVE_USELOCALE
410# ifndef HAVE_NEWLOCALE
411# define LC_ALL_MASK 0
412# define LC_NUMERIC_MASK 0
413# define LC_MESSAGES_MASK 0
414# define LC_GLOBAL_LOCALE ((locale_t)(uintptr_t)1)
415typedef void *locale_t;
417static inline void freelocale(locale_t loc)
419 (void)loc;
420}
421static inline locale_t newlocale(int mask, const char * locale, locale_t base)
423 (void)mask; (void)locale; (void)base;
424 return NULL;
425}
426# else
427# include <locale.h>
428# endif
429
430static inline locale_t uselocale(locale_t loc)
432 (void)loc;
433 return NULL;
434}
435#endif
436
437/* libintl support */
438#define _(str) vlc_gettext (str)
439#define N_(str) gettext_noop (str)
440#define gettext_noop(str) (str)
442#ifdef __cplusplus
443extern "C" {
444#endif
445
446#ifndef HAVE_SWAB
447/* Android NDK25 have swab but configure fails to detect it */
448#ifndef __ANDROID__
449void swab (const void *, void *, ssize_t);
450#endif
451#endif
452
453/* Socket stuff */
454#ifndef HAVE_INET_PTON
455# ifdef __cplusplus
456}
457# endif
458# ifndef _WIN32
459# include <sys/socket.h>
460#else
461typedef int socklen_t;
462# endif
463# ifdef __cplusplus
464extern "C" {
465# endif
466
467int inet_pton(int, const char *, void *);
468const char *inet_ntop(int, const void *, char *, socklen_t);
469#endif
470
471#ifndef HAVE_STRUCT_POLLFD
472enum
473{
474 POLLERR=0x1,
481 POLLPRI=0x400,
483#define POLLIN (POLLRDNORM|POLLRDBAND)
484#define POLLOUT (POLLWRNORM|POLLWRBAND)
486struct pollfd
488 int fd;
489 short events;
490 short revents;
492#endif
493#ifndef HAVE_POLL
494struct pollfd;
495int poll (struct pollfd *, unsigned, int);
496#endif
497
498#ifndef HAVE_IF_NAMEINDEX
499# ifdef __cplusplus
500}
501# endif
502#include <errno.h>
503# ifdef __cplusplus
504extern "C" {
505# endif
506# ifndef HAVE_STRUCT_IF_NAMEINDEX
507struct if_nameindex
509 unsigned if_index;
510 char *if_name;
512# endif
513# define if_nameindex() (errno = ENOBUFS, NULL)
514# define if_freenameindex(list) (void)0
515#endif
516
517#ifndef HAVE_STRUCT_TIMESPEC
518struct timespec {
519 time_t tv_sec; /* Seconds */
520 long tv_nsec; /* Nanoseconds */
522#endif
523
524#ifdef _WIN32
525struct iovec
526{
527 void *iov_base;
528 size_t iov_len;
529};
530#define IOV_MAX 255
531struct msghdr
532{
533 void *msg_name;
534 size_t msg_namelen;
535 struct iovec *msg_iov;
536 size_t msg_iovlen;
537 void *msg_control;
538 size_t msg_controllen;
539 int msg_flags;
540};
541
542# ifndef HAVE_IF_NAMETOINDEX
543# ifdef __cplusplus
544}
545# endif
546# include <stdlib.h> /* a define may change from the real atoi declaration */
547# ifdef __cplusplus
548extern "C" {
549# endif
550static inline int if_nametoindex(const char *name)
551{
552 return atoi(name);
553}
554# endif
555#endif
556
557#ifdef _NEWLIB_VERSION
558#define IOV_MAX 255
559#endif
560
561#ifndef HAVE_RECVMSG
562struct msghdr;
563ssize_t recvmsg(int, struct msghdr *, int);
564#endif
565
566#ifndef HAVE_SENDMSG
567struct msghdr;
568ssize_t sendmsg(int, const struct msghdr *, int);
569#endif
570
571/* search.h */
572#ifndef HAVE_TFIND
573typedef enum {
580void *tsearch( const void *key, void **rootp, int(*cmp)(const void *, const void *) );
581void *tfind( const void *key, void * const *rootp, int(*cmp)(const void *, const void *) );
582void *tdelete( const void *key, void **rootp, int(*cmp)(const void *, const void *) );
583void twalk( const void *root, void(*action)(const void *nodep, VISIT which, int depth) );
584#ifndef _WIN32
585/* the Win32 prototype of lfind() expects an unsigned* for 'nmemb' */
586void *lfind( const void *key, const void *base, size_t *nmemb,
587 size_t size, int(*cmp)(const void *, const void *) );
588#endif
589#endif /* HAVE_TFIND */
590
591#ifndef HAVE_TDESTROY
592void tdestroy( void *root, void (*free_node)(void *nodep) );
593#endif
594
595/* sys/auxv.h */
596#ifndef HAVE_GETAUXVAL
597unsigned long getauxval(unsigned long);
598#endif
599
600/* Random numbers */
601#ifndef HAVE_NRAND48
602double erand48 (unsigned short subi[3]);
603long jrand48 (unsigned short subi[3]);
604long nrand48 (unsigned short subi[3]);
605#endif
606
607#ifdef __OS2__
608# undef HAVE_FORK /* Implementation of fork() is imperfect on OS/2 */
609
610# define SHUT_RD 0
611# define SHUT_WR 1
612# define SHUT_RDWR 2
613
614/* GAI error codes */
615# ifndef EAI_BADFLAGS
616# define EAI_BADFLAGS -1
617# endif
618# ifndef EAI_NONAME
619# define EAI_NONAME -2
620# endif
621# ifndef EAI_AGAIN
622# define EAI_AGAIN -3
623# endif
624# ifndef EAI_FAIL
625# define EAI_FAIL -4
626# endif
627# ifndef EAI_NODATA
628# define EAI_NODATA -5
629# endif
630# ifndef EAI_FAMILY
631# define EAI_FAMILY -6
632# endif
633# ifndef EAI_SOCKTYPE
634# define EAI_SOCKTYPE -7
635# endif
636# ifndef EAI_SERVICE
637# define EAI_SERVICE -8
638# endif
639# ifndef EAI_ADDRFAMILY
640# define EAI_ADDRFAMILY -9
641# endif
642# ifndef EAI_MEMORY
643# define EAI_MEMORY -10
644# endif
645# ifndef EAI_OVERFLOW
646# define EAI_OVERFLOW -11
647# endif
648# ifndef EAI_SYSTEM
649# define EAI_SYSTEM -12
650# endif
651
652# ifndef NI_NUMERICHOST
653# define NI_NUMERICHOST 0x01
654# define NI_NUMERICSERV 0x02
655# define NI_NOFQDN 0x04
656# define NI_NAMEREQD 0x08
657# define NI_DGRAM 0x10
658# endif
659
660# ifndef NI_MAXHOST
661# define NI_MAXHOST 1025
662# define NI_MAXSERV 32
663# endif
664
665# define AI_PASSIVE 1
666# define AI_CANONNAME 2
667# define AI_NUMERICHOST 4
668
669struct addrinfo
670{
671 int ai_flags;
672 int ai_family;
673 int ai_socktype;
674 int ai_protocol;
675 size_t ai_addrlen;
676 struct sockaddr *ai_addr;
677 char *ai_canonname;
678 struct addrinfo *ai_next;
679};
680
681# ifdef __LIBCN__
682/* OS/2 LIBCn has inet_pton(). Because of this, socklen_t is not defined above.
683 * And OS/2 LIBCn has socklen_t. So include sys/socket.h here for socklen_t. */
684# include <sys/socket.h>
685# endif
686
687const char *gai_strerror (int);
688
689int getaddrinfo (const char *node, const char *service,
690 const struct addrinfo *hints, struct addrinfo **res);
691void freeaddrinfo (struct addrinfo *res);
692int getnameinfo (const struct sockaddr *sa, socklen_t salen,
693 char *host, int hostlen, char *serv, int servlen,
694 int flags);
695
696/* OS/2 does not support IPv6, yet. But declare these only for compilation */
697# include <stdint.h>
698
699struct in6_addr
700{
701 uint8_t s6_addr[16];
702};
703
704struct sockaddr_in6
705{
706 uint8_t sin6_len;
707 uint8_t sin6_family;
708 uint16_t sin6_port;
709 uint32_t sin6_flowinfo;
710 struct in6_addr sin6_addr;
711 uint32_t sin6_scope_id;
712};
713
714# define IN6_IS_ADDR_MULTICAST(a) (((__const uint8_t *) (a))[0] == 0xff)
715
716# define INET6_ADDRSTRLEN 46
717
718static const struct in6_addr in6addr_any =
719 { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };
720
721static const struct in6_addr in6addr_loopback =
722 { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 } };
723
724#define IN6ADDR_ANY_INIT \
725 { { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } }
726
727#define IN6ADDR_LOOPBACK_INIT \
728 { { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 } } }
729
730# include <errno.h>
731# ifndef EPROTO
732# define EPROTO (ELAST + 1)
733# endif
734
735# ifndef HAVE_IF_NAMETOINDEX
736# define if_nametoindex(name) atoi(name)
737# endif
738
739/* static_assert missing in assert.h */
740# if defined(__STDC_VERSION__) && \
741 __STDC_VERSION__ >= 201112L && __STDC_VERSION__ < 202311L
742# include <assert.h>
743# ifndef static_assert
744# define static_assert _Static_assert
745# endif
746# endif
747#endif /* __OS2__ */
748
749/* math.h */
750
751#ifndef HAVE_NANF
752#define nanf(tagp) NAN
753#endif
754
755#ifndef HAVE_SINCOS
756void (sincos)(double, double *, double *);
757void (sincosf)(float, float *, float *);
758#endif
759
760#ifndef HAVE_REALPATH
761char *realpath(const char * restrict pathname, char * restrict resolved_path);
762#endif
763
764#ifdef __APPLE__
765# define fdatasync fsync
766
767# ifdef __cplusplus
768}
769# endif
770# include <time.h>
771# ifdef __cplusplus
772extern "C" {
773# endif
774# ifndef TIMER_ABSTIME
775# define TIMER_ABSTIME 0x01
776# endif
777# ifndef CLOCK_REALTIME
778# define CLOCK_REALTIME 0
779# endif
780# ifndef CLOCK_MONOTONIC
781# define CLOCK_MONOTONIC 6
782# endif
783# ifndef HAVE_CLOCK_GETTIME
784int clock_gettime(clockid_t clock_id, struct timespec *tp);
785# endif
786# ifndef HAVE_CLOCK_GETRES
787int clock_getres(clockid_t clock_id, struct timespec *tp);
788# endif
789#endif
790
791#ifndef _WIN32
792# ifndef HAVE_CLOCK_NANOSLEEP
793# ifdef __cplusplus
794}
795# endif
796# include <time.h>
797# ifdef __cplusplus
798extern "C" {
799# endif
800int clock_nanosleep(clockid_t clock_id, int flags,
801 const struct timespec *rqtp, struct timespec *rmtp);
802# endif
803#endif
804
805#ifdef _WIN32
806# if defined(_CRT_INTERNAL_NONSTDC_NAMES) && !_CRT_INTERNAL_NONSTDC_NAMES
807# include <string.h>
808// the MS POSIX aliases are missing
809static inline char *strdup(const char *str)
810{
811 return _strdup(str);
812}
813
814# define O_WRONLY _O_WRONLY
815# define O_CREAT _O_CREAT
816# define O_APPEND _O_APPEND
817# define O_TRUNC _O_TRUNC
818# define O_BINARY _O_BINARY
819# define O_EXCL _O_EXCL
820# define O_RDWR _O_RDWR
821# define O_TEXT _O_TEXT
822# define O_NOINHERIT _O_NOINHERIT
823# define O_RDONLY _O_RDONLY
824
825# endif // !_CRT_INTERNAL_NONSTDC_NAMES
826#endif // _WIN32
827
828
829#ifdef __cplusplus
830} /* extern "C" */
831#endif
832
833#if defined(__cplusplus)
834#ifndef HAVE_CXX_TYPEOF
835# include <type_traits>
836# define typeof(t) std::remove_reference<decltype(t)>::type
837#endif
838#endif
839
840#endif /* !LIBVLC_FIXUPS_H */
const char name[16]
Definition httpd.c:1298
unsigned short subi[3]
Definition rand.c:32
int getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res)
Definition getaddrinfo.c:186
int getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, int hostlen, char *serv, int servlen, int flags)
Definition getaddrinfo.c:49
unsigned if_index
Definition vlc_fixups.h:510
char * if_name
Definition vlc_fixups.h:511
Definition vlc_fixups.h:143
long long rem
Definition vlc_fixups.h:145
long long quot
Definition vlc_fixups.h:144
Definition vlc_fixups.h:201
long long ll
Definition vlc_fixups.h:202
long double ld
Definition vlc_fixups.h:203
Definition vlc_fixups.h:488
int fd
Definition vlc_fixups.h:489
short revents
Definition vlc_fixups.h:491
short events
Definition vlc_fixups.h:490
Definition vlc_fixups.h:519
long tv_nsec
Definition vlc_fixups.h:521
time_t tv_sec
Definition vlc_fixups.h:520
This file is a collection of common definitions and types.
ssize_t recvmsg(int, struct msghdr *, int)
float strtof(const char *, char **)
@ POLLRDBAND
Definition vlc_fixups.h:481
@ POLLWRBAND
Definition vlc_fixups.h:479
@ POLLPRI
Definition vlc_fixups.h:482
@ POLLRDNORM
Definition vlc_fixups.h:480
@ POLLHUP
Definition vlc_fixups.h:476
@ POLLNVAL
Definition vlc_fixups.h:477
@ POLLWRNORM
Definition vlc_fixups.h:478
@ POLLERR
Definition vlc_fixups.h:475
void * tfind(const void *key, void *const *rootp, int(*cmp)(const void *, const void *))
int inet_pton(int, const char *, void *)
ssize_t readv(int, const struct iovec *, int)
ssize_t getdelim(char **, size_t *, int, FILE *)
#define VLC_NOTHROW
Definition vlc_fixups.h:196
double erand48(unsigned short subi[3])
int getc_unlocked(FILE *)
void * aligned_alloc(size_t, size_t)
static void freelocale(locale_t loc)
Definition vlc_fixups.h:418
int posix_memalign(void **, size_t, size_t)
char * strdup(const char *)
lldiv_t lldiv(long long, long long)
void sincos(double, double *, double *)
DIR * fdopendir(int)
int putc_unlocked(int, FILE *)
const char * inet_ntop(int, const void *, char *, socklen_t)
long nrand48(unsigned short subi[3])
int vasprintf(char **, const char *, va_list)
double atof(const char *)
int putchar_unlocked(int)
static locale_t uselocale(locale_t loc)
Definition vlc_fixups.h:431
struct tm * localtime_r(const time_t *, struct tm *)
#define if_nameindex()
Definition vlc_fixups.h:514
char * strnstr(const char *, const char *, size_t)
long long atoll(const char *)
void twalk(const void *root, void(*action)(const void *nodep, VISIT which, int depth))
int setenv(const char *, const char *, int)
int unsetenv(const char *)
void sincosf(float, float *, float *)
time_t timegm(struct tm *)
unsigned long getauxval(unsigned long)
char * realpath(const char *restrict pathname, char *restrict resolved_path)
long jrand48(unsigned short subi[3])
int timespec_get(struct timespec *, int)
size_t strlcpy(char *, const char *, size_t)
int dirfd(DIR *)
static char * getenv(const char *name)
Definition vlc_fixups.h:370
ssize_t getline(char **, size_t *, FILE *)
static locale_t newlocale(int mask, const char *locale, locale_t base)
Definition vlc_fixups.h:422
ssize_t writev(int, const struct iovec *, int)
void * lfind(const void *key, const void *base, size_t *nmemb, size_t size, int(*cmp)(const void *, const void *))
long long int strtoll(const char *, char **, int)
void * tdelete(const void *key, void **rootp, int(*cmp)(const void *, const void *))
void swab(const void *, void *, ssize_t)
int strcasecmp(const char *, const char *)
int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp)
int fsync(int fd)
void flockfile(FILE *)
void * locale_t
Definition vlc_fixups.h:416
int poll(struct pollfd *, unsigned, int)
void * tsearch(const void *key, void **rootp, int(*cmp)(const void *, const void *))
void tdestroy(void *root, void(*free_node)(void *nodep))
char * strndup(const char *, size_t)
char * strtok_r(char *, const char *, char **)
void * memrchr(const void *, int, size_t)
pid_t getpid(void)
char * strcasestr(const char *, const char *)
struct tm * gmtime_r(const time_t *, struct tm *)
int strverscmp(const char *, const char *)
ssize_t sendmsg(int, const struct msghdr *, int)
size_t strnlen(const char *, size_t)
void rewind(FILE *)
VISIT
Definition vlc_fixups.h:574
@ postorder
Definition vlc_fixups.h:576
@ leaf
Definition vlc_fixups.h:578
@ endorder
Definition vlc_fixups.h:577
@ preorder
Definition vlc_fixups.h:575
int asprintf(char **, const char *,...)
void funlockfile(FILE *)
int getchar_unlocked(void)
char * strsep(char **, const char *)