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_GETTIMEOFDAY
141#ifdef _WIN32
142#include <winsock2.h>
143#else
144#include <sys/time.h>
145#endif
146#endif
147
148#ifndef HAVE_LLDIV
149typedef struct
151 long long quot; /* Quotient. */
152 long long rem; /* Remainder. */
154#endif
155
156#if !defined(HAVE_GETENV) || \
157 !defined(HAVE_USELOCALE)
158# include <stddef.h> /* NULL */
159#endif
160
161#if !defined (HAVE_REWIND) || \
162 !defined (HAVE_GETDELIM)
163# include <stdio.h> /* FILE */
164#endif
165
166#if !defined (HAVE_ALIGNED_ALLOC) || \
167 !defined (HAVE_MEMRCHR) || \
168 !defined (HAVE_POSIX_MEMALIGN) || \
169 !defined (HAVE_QSORT_R) || \
170 !defined (HAVE_STRLCPY) || \
171 !defined (HAVE_STRNDUP) || \
172 !defined (HAVE_STRNLEN) || \
173 !defined (HAVE_STRNSTR)
174# include <stddef.h> /* size_t */
175#endif
176
177#ifndef HAVE_VASPRINTF
178# include <stdarg.h> /* va_list */
179#endif
180
181#if !defined (HAVE_GETDELIM) || \
182 !defined (HAVE_GETPID) || \
183 !defined (HAVE_SWAB) || \
184 !defined (HAVE_WRITEV) || \
185 !defined (HAVE_READV)
186# include <sys/types.h> /* ssize_t, pid_t */
187
188# if defined(_CRT_INTERNAL_NONSTDC_NAMES) && !_CRT_INTERNAL_NONSTDC_NAMES
189// MS POSIX aliases missing
190typedef _off_t off_t;
191# endif
192#endif
193
194#if !defined (HAVE_DIRFD) || \
195 !defined (HAVE_FDOPENDIR)
196# include <dirent.h>
197#endif
198
199#ifdef __cplusplus
200# define VLC_NOTHROW throw ()
201extern "C" {
202#else
203# define VLC_NOTHROW
204#endif
205
206/* stddef.h */
207#if !defined (__cplusplus) && !defined (HAVE_MAX_ALIGN_T)
208typedef struct {
209 long long ll;
210 long double ld;
212#endif
213
214/* stdio.h */
215#ifndef HAVE_ASPRINTF
216int asprintf (char **, const char *, ...);
217#endif
218
219#ifndef HAVE_FLOCKFILE
220void flockfile (FILE *);
221void funlockfile (FILE *);
222int getc_unlocked (FILE *);
224int putc_unlocked (int, FILE *);
226#endif
227
228#ifndef HAVE_GETDELIM
229ssize_t getdelim (char **, size_t *, int, FILE *);
230ssize_t getline (char **, size_t *, FILE *);
231#endif
232
233#ifndef HAVE_REWIND
234void rewind (FILE *);
235#endif
236
237#ifndef HAVE_VASPRINTF
238int vasprintf (char **, const char *, va_list);
239#endif
240
241/* string.h */
242#ifndef HAVE_MEMRCHR
243void *memrchr(const void *, int, size_t);
244#endif
245
246#ifndef HAVE_STRCASECMP
247int strcasecmp (const char *, const char *);
248#endif
249
250#ifndef HAVE_STRCASESTR
251char *strcasestr (const char *, const char *);
252#endif
253
254#ifndef HAVE_STRDUP
255char *strdup (const char *);
256#endif
257
258#ifndef HAVE_STRVERSCMP
259int strverscmp (const char *, const char *);
260#endif
261
262#ifndef HAVE_STRNLEN
263size_t strnlen (const char *, size_t);
264#endif
265
266#ifndef HAVE_STRNSTR
267char * strnstr (const char *, const char *, size_t);
268#endif
269
270#ifndef HAVE_STRNDUP
271char *strndup (const char *, size_t);
272#endif
273
274#ifndef HAVE_STRLCPY
275size_t strlcpy (char *, const char *, size_t);
276#endif
277
278#ifndef HAVE_STRSEP
279char *strsep (char **, const char *);
280#endif
281
282#ifndef HAVE_STRTOK_R
283char *strtok_r(char *, const char *, char **);
284#endif
285
286/* stdlib.h */
287#ifndef HAVE_ATOF
288#ifndef __ANDROID__
289double atof (const char *);
290#endif
291#endif
292
293#ifndef HAVE_ATOLL
294long long atoll (const char *);
295#endif
296
297#ifndef HAVE_LLDIV
298lldiv_t lldiv (long long, long long);
299#endif
300
301#ifndef HAVE_STRTOF
302#ifndef __ANDROID__
303float strtof (const char *, char **);
304#endif
305#endif
306
307#ifndef HAVE_STRTOLL
308long long int strtoll (const char *, char **, int);
309#endif
310
311/* sys/uio.h */
312#ifndef HAVE_READV
313struct iovec;
314ssize_t readv(int, const struct iovec *, int);
315#endif
316
317#ifndef HAVE_WRITEV
318struct iovec;
319ssize_t writev(int, const struct iovec *, int);
320#endif
321
322/* time.h */
323#ifndef HAVE_GMTIME_R
324struct tm *gmtime_r (const time_t *, struct tm *);
325#endif
326
327#ifndef HAVE_LOCALTIME_R
328struct tm *localtime_r (const time_t *, struct tm *);
329#endif
330
331#ifndef HAVE_TIMEGM
332time_t timegm(struct tm *);
333#endif
334
335#ifndef HAVE_TIMESPEC_GET
336#ifndef TIME_UTC
337#define TIME_UTC 1
338#endif
339struct timespec;
340int timespec_get(struct timespec *, int);
341#endif
342
343/* sys/time.h */
344#ifndef HAVE_GETTIMEOFDAY
345struct timezone;
346int gettimeofday(struct timeval *, struct timezone *);
347#endif
348
349#if defined(WIN32) && !defined(WINSTORECOMPAT)
350#include <winapifamily.h>
351#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
352// getpid is incorrectly detected in UWP so we won't use the compat version
353#include <processthreadsapi.h>
354#define getpid() GetCurrentProcessId()
355#endif
356#endif
357
358/* unistd.h */
359#ifndef HAVE_GETPID
360pid_t getpid (void) VLC_NOTHROW;
361#endif
362
363#ifndef HAVE_FSYNC
364int fsync (int fd);
365#endif
366
367/* dirent.h */
368#ifndef HAVE_DIRFD
369int (dirfd) (DIR *);
370#endif
371
372#ifndef HAVE_FDOPENDIR
373DIR *fdopendir (int);
374#endif
375
376#ifdef __cplusplus
377} /* extern "C" */
378#endif
379
380/* stdlib.h */
381#ifndef HAVE_GETENV
382static inline char *getenv (const char *name)
384 (void)name;
385 return NULL;
386}
387#endif
388
389#ifdef __cplusplus
390extern "C" {
391#endif
392
393#ifndef HAVE_SETENV
394int setenv (const char *, const char *, int);
395int unsetenv (const char *);
396#endif
397
398#ifndef HAVE_POSIX_MEMALIGN
399int posix_memalign(void **, size_t, size_t);
400#endif
401
402#ifndef HAVE_ALIGNED_ALLOC
403void *aligned_alloc(size_t, size_t);
404#endif
405
406#ifdef __cplusplus
407} /* extern "C" */
408#endif
409
410#if defined (_WIN32)
411#define aligned_free(ptr) _aligned_free(ptr)
412#else
413#define aligned_free(ptr) free(ptr)
414#endif
415
416#if !defined(HAVE_NEWLOCALE) && defined(HAVE_CXX_LOCALE_T) && defined(__cplusplus)
417# include <locale>
418# define HAVE_NEWLOCALE
419#endif
420
421/* locale.h */
422#ifndef HAVE_USELOCALE
423# ifndef HAVE_NEWLOCALE
424# define LC_ALL_MASK 0
425# define LC_NUMERIC_MASK 0
426# define LC_MESSAGES_MASK 0
427# define LC_GLOBAL_LOCALE ((locale_t)(uintptr_t)1)
428typedef void *locale_t;
430static inline void freelocale(locale_t loc)
432 (void)loc;
433}
434static inline locale_t newlocale(int mask, const char * locale, locale_t base)
436 (void)mask; (void)locale; (void)base;
437 return NULL;
438}
439# else
440# include <locale.h>
441# endif
442
443static inline locale_t uselocale(locale_t loc)
445 (void)loc;
446 return NULL;
447}
448#endif
449
450/* libintl support */
451#define _(str) vlc_gettext (str)
452#define N_(str) gettext_noop (str)
453#define gettext_noop(str) (str)
455#ifdef __cplusplus
456extern "C" {
457#endif
458
459#ifndef HAVE_SWAB
460/* Android NDK25 have swab but configure fails to detect it */
461#ifndef __ANDROID__
462void swab (const void *, void *, ssize_t);
463#endif
464#endif
465
466/* Socket stuff */
467#ifndef HAVE_INET_PTON
468# ifdef __cplusplus
469}
470# endif
471# ifndef _WIN32
472# include <sys/socket.h>
473#else
474typedef int socklen_t;
475# endif
476# ifdef __cplusplus
477extern "C" {
478# endif
479
480int inet_pton(int, const char *, void *);
481const char *inet_ntop(int, const void *, char *, socklen_t);
482#endif
483
484#ifndef HAVE_STRUCT_POLLFD
485enum
486{
487 POLLERR=0x1,
494 POLLPRI=0x400,
496#define POLLIN (POLLRDNORM|POLLRDBAND)
497#define POLLOUT (POLLWRNORM|POLLWRBAND)
499struct pollfd
501 int fd;
502 short events;
503 short revents;
505#endif
506#ifndef HAVE_POLL
507struct pollfd;
508int poll (struct pollfd *, unsigned, int);
509#endif
510
511#ifndef HAVE_IF_NAMEINDEX
512# ifdef __cplusplus
513}
514# endif
515#include <errno.h>
516# ifdef __cplusplus
517extern "C" {
518# endif
519# ifndef HAVE_STRUCT_IF_NAMEINDEX
520struct if_nameindex
522 unsigned if_index;
523 char *if_name;
525# endif
526# define if_nameindex() (errno = ENOBUFS, NULL)
527# define if_freenameindex(list) (void)0
528#endif
529
530#ifndef HAVE_STRUCT_TIMESPEC
531struct timespec {
532 time_t tv_sec; /* Seconds */
533 long tv_nsec; /* Nanoseconds */
535#endif
536
537#ifdef _WIN32
538struct iovec
539{
540 void *iov_base;
541 size_t iov_len;
542};
543#define IOV_MAX 255
544struct msghdr
545{
546 void *msg_name;
547 size_t msg_namelen;
548 struct iovec *msg_iov;
549 size_t msg_iovlen;
550 void *msg_control;
551 size_t msg_controllen;
552 int msg_flags;
553};
554
555# ifndef HAVE_IF_NAMETOINDEX
556# ifdef __cplusplus
557}
558# endif
559# include <stdlib.h> /* a define may change from the real atoi declaration */
560# ifdef __cplusplus
561extern "C" {
562# endif
563static inline int if_nametoindex(const char *name)
564{
565 return atoi(name);
566}
567# endif
568#endif
569
570#ifdef _NEWLIB_VERSION
571#define IOV_MAX 255
572#endif
573
574#ifndef HAVE_RECVMSG
575struct msghdr;
576ssize_t recvmsg(int, struct msghdr *, int);
577#endif
578
579#ifndef HAVE_SENDMSG
580struct msghdr;
581ssize_t sendmsg(int, const struct msghdr *, int);
582#endif
583
584/* search.h */
585#ifndef HAVE_TFIND
586typedef enum {
593void *tsearch( const void *key, void **rootp, int(*cmp)(const void *, const void *) );
594void *tfind( const void *key, void * const *rootp, int(*cmp)(const void *, const void *) );
595void *tdelete( const void *key, void **rootp, int(*cmp)(const void *, const void *) );
596void twalk( const void *root, void(*action)(const void *nodep, VISIT which, int depth) );
597#ifndef _WIN32
598/* the Win32 prototype of lfind() expects an unsigned* for 'nmemb' */
599void *lfind( const void *key, const void *base, size_t *nmemb,
600 size_t size, int(*cmp)(const void *, const void *) );
601#endif
602#endif /* HAVE_TFIND */
603
604#ifndef HAVE_TDESTROY
605void tdestroy( void *root, void (*free_node)(void *nodep) );
606#endif
607
608/* sys/auxv.h */
609#ifndef HAVE_GETAUXVAL
610unsigned long getauxval(unsigned long);
611#endif
612
613/* Random numbers */
614#ifndef HAVE_NRAND48
615double erand48 (unsigned short subi[3]);
616long jrand48 (unsigned short subi[3]);
617long nrand48 (unsigned short subi[3]);
618#endif
619
620#ifdef __OS2__
621# undef HAVE_FORK /* Implementation of fork() is imperfect on OS/2 */
622
623# define SHUT_RD 0
624# define SHUT_WR 1
625# define SHUT_RDWR 2
626
627/* GAI error codes */
628# ifndef EAI_BADFLAGS
629# define EAI_BADFLAGS -1
630# endif
631# ifndef EAI_NONAME
632# define EAI_NONAME -2
633# endif
634# ifndef EAI_AGAIN
635# define EAI_AGAIN -3
636# endif
637# ifndef EAI_FAIL
638# define EAI_FAIL -4
639# endif
640# ifndef EAI_NODATA
641# define EAI_NODATA -5
642# endif
643# ifndef EAI_FAMILY
644# define EAI_FAMILY -6
645# endif
646# ifndef EAI_SOCKTYPE
647# define EAI_SOCKTYPE -7
648# endif
649# ifndef EAI_SERVICE
650# define EAI_SERVICE -8
651# endif
652# ifndef EAI_ADDRFAMILY
653# define EAI_ADDRFAMILY -9
654# endif
655# ifndef EAI_MEMORY
656# define EAI_MEMORY -10
657# endif
658# ifndef EAI_OVERFLOW
659# define EAI_OVERFLOW -11
660# endif
661# ifndef EAI_SYSTEM
662# define EAI_SYSTEM -12
663# endif
664
665# ifndef NI_NUMERICHOST
666# define NI_NUMERICHOST 0x01
667# define NI_NUMERICSERV 0x02
668# define NI_NOFQDN 0x04
669# define NI_NAMEREQD 0x08
670# define NI_DGRAM 0x10
671# endif
672
673# ifndef NI_MAXHOST
674# define NI_MAXHOST 1025
675# define NI_MAXSERV 32
676# endif
677
678# define AI_PASSIVE 1
679# define AI_CANONNAME 2
680# define AI_NUMERICHOST 4
681
682struct addrinfo
683{
684 int ai_flags;
685 int ai_family;
686 int ai_socktype;
687 int ai_protocol;
688 size_t ai_addrlen;
689 struct sockaddr *ai_addr;
690 char *ai_canonname;
691 struct addrinfo *ai_next;
692};
693
694# ifdef __LIBCN__
695/* OS/2 LIBCn has inet_pton(). Because of this, socklen_t is not defined above.
696 * And OS/2 LIBCn has socklen_t. So include sys/socket.h here for socklen_t. */
697# include <sys/socket.h>
698# endif
699
700const char *gai_strerror (int);
701
702int getaddrinfo (const char *node, const char *service,
703 const struct addrinfo *hints, struct addrinfo **res);
704void freeaddrinfo (struct addrinfo *res);
705int getnameinfo (const struct sockaddr *sa, socklen_t salen,
706 char *host, int hostlen, char *serv, int servlen,
707 int flags);
708
709/* OS/2 does not support IPv6, yet. But declare these only for compilation */
710# include <stdint.h>
711
712struct in6_addr
713{
714 uint8_t s6_addr[16];
715};
716
717struct sockaddr_in6
718{
719 uint8_t sin6_len;
720 uint8_t sin6_family;
721 uint16_t sin6_port;
722 uint32_t sin6_flowinfo;
723 struct in6_addr sin6_addr;
724 uint32_t sin6_scope_id;
725};
726
727# define IN6_IS_ADDR_MULTICAST(a) (((__const uint8_t *) (a))[0] == 0xff)
728
729# define INET6_ADDRSTRLEN 46
730
731static const struct in6_addr in6addr_any =
732 { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };
733
734#define IN6ADDR_ANY_INIT \
735 { { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } }
736
737# include <errno.h>
738# ifndef EPROTO
739# define EPROTO (ELAST + 1)
740# endif
741
742# ifndef HAVE_IF_NAMETOINDEX
743# define if_nametoindex(name) atoi(name)
744# endif
745
746/* static_assert missing in assert.h */
747# if defined(__STDC_VERSION__) && \
748 __STDC_VERSION__ >= 201112L && __STDC_VERSION__ < 202311L
749# include <assert.h>
750# ifndef static_assert
751# define static_assert _Static_assert
752# endif
753# endif
754#endif /* __OS2__ */
755
756/* math.h */
757
758#ifndef HAVE_NANF
759#define nanf(tagp) NAN
760#endif
761
762#ifndef HAVE_SINCOS
763void sincos(double, double *, double *);
764void sincosf(float, float *, float *);
765#endif
766
767#ifndef HAVE_REALPATH
768char *realpath(const char * restrict pathname, char * restrict resolved_path);
769#endif
770
771/* mingw-w64 has a broken IN6_IS_ADDR_MULTICAST macro */
772#if defined(_WIN32) && defined(__MINGW64_VERSION_MAJOR)
773# define IN6_IS_ADDR_MULTICAST IN6_IS_ADDR_MULTICAST
774#endif
775
776#ifdef __APPLE__
777# define fdatasync fsync
778
779# ifdef __cplusplus
780}
781# endif
782# include <time.h>
783# ifdef __cplusplus
784extern "C" {
785# endif
786# ifndef TIMER_ABSTIME
787# define TIMER_ABSTIME 0x01
788# endif
789# ifndef CLOCK_REALTIME
790# define CLOCK_REALTIME 0
791# endif
792# ifndef CLOCK_MONOTONIC
793# define CLOCK_MONOTONIC 6
794# endif
795# ifndef HAVE_CLOCK_GETTIME
796int clock_gettime(clockid_t clock_id, struct timespec *tp);
797# endif
798# ifndef HAVE_CLOCK_GETRES
799int clock_getres(clockid_t clock_id, struct timespec *tp);
800# endif
801#endif
802
803#ifndef _WIN32
804# ifndef HAVE_CLOCK_NANOSLEEP
805# ifdef __cplusplus
806}
807# endif
808# include <time.h>
809# ifdef __cplusplus
810extern "C" {
811# endif
812int clock_nanosleep(clockid_t clock_id, int flags,
813 const struct timespec *rqtp, struct timespec *rmtp);
814# endif
815#endif
816
817#ifdef _WIN32
818# if defined(_CRT_INTERNAL_NONSTDC_NAMES) && !_CRT_INTERNAL_NONSTDC_NAMES
819# include <string.h>
820// the MS POSIX aliases are missing
821static inline char *strdup(const char *str)
822{
823 return _strdup(str);
824}
825
826# define O_WRONLY _O_WRONLY
827# define O_CREAT _O_CREAT
828# define O_APPEND _O_APPEND
829# define O_TRUNC _O_TRUNC
830# define O_BINARY _O_BINARY
831# define O_EXCL _O_EXCL
832# define O_RDWR _O_RDWR
833# define O_TEXT _O_TEXT
834# define O_NOINHERIT _O_NOINHERIT
835# define O_RDONLY _O_RDONLY
836
837# endif // !_CRT_INTERNAL_NONSTDC_NAMES
838#endif // _WIN32
839
840
841#ifdef __cplusplus
842} /* extern "C" */
843#endif
844
845#if defined(__cplusplus)
846#ifndef HAVE_CXX_TYPEOF
847# include <type_traits>
848# define typeof(t) std::remove_reference<decltype(t)>::type
849#endif
850#endif
851
852#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:187
int getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, int hostlen, char *serv, int servlen, int flags)
Definition getaddrinfo.c:49
Definition vlc_fixups.h:522
unsigned if_index
Definition vlc_fixups.h:523
char * if_name
Definition vlc_fixups.h:524
Definition vlc_fixups.h:151
long long rem
Definition vlc_fixups.h:153
long long quot
Definition vlc_fixups.h:152
Definition vlc_fixups.h:209
long long ll
Definition vlc_fixups.h:210
long double ld
Definition vlc_fixups.h:211
Definition vlc_fixups.h:501
int fd
Definition vlc_fixups.h:502
short revents
Definition vlc_fixups.h:504
short events
Definition vlc_fixups.h:503
Definition vlc_fixups.h:532
long tv_nsec
Definition vlc_fixups.h:534
time_t tv_sec
Definition vlc_fixups.h:533
This file is a collection of common definitions and types.
ssize_t recvmsg(int, struct msghdr *, int)
float strtof(const char *, char **)
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)
int gettimeofday(struct timeval *, struct timezone *)
ssize_t getdelim(char **, size_t *, int, FILE *)
#define VLC_NOTHROW
Definition vlc_fixups.h:204
@ POLLRDBAND
Definition vlc_fixups.h:494
@ POLLWRBAND
Definition vlc_fixups.h:492
@ POLLPRI
Definition vlc_fixups.h:495
@ POLLRDNORM
Definition vlc_fixups.h:493
@ POLLHUP
Definition vlc_fixups.h:489
@ POLLNVAL
Definition vlc_fixups.h:490
@ POLLWRNORM
Definition vlc_fixups.h:491
@ POLLERR
Definition vlc_fixups.h:488
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:431
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 *)
int() dirfd(DIR *)
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:444
struct tm * localtime_r(const time_t *, struct tm *)
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)
static char * getenv(const char *name)
Definition vlc_fixups.h:383
ssize_t getline(char **, size_t *, FILE *)
static locale_t newlocale(int mask, const char *locale, locale_t base)
Definition vlc_fixups.h:435
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:429
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:587
@ postorder
Definition vlc_fixups.h:589
@ leaf
Definition vlc_fixups.h:591
@ endorder
Definition vlc_fixups.h:590
@ preorder
Definition vlc_fixups.h:588
int asprintf(char **, const char *,...)
void funlockfile(FILE *)
int getchar_unlocked(void)
char * strsep(char **, const char *)