VLC 4.0.0-dev
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#define TIME_UTC 1
337struct timespec;
338int timespec_get(struct timespec *, int);
339#endif
340
341/* sys/time.h */
342#ifndef HAVE_GETTIMEOFDAY
343struct timezone;
344int gettimeofday(struct timeval *, struct timezone *);
345#endif
346
347#if defined(WIN32) && !defined(WINSTORECOMPAT)
348#include <winapifamily.h>
349#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
350// getpid is incorrectly detected in UWP so we won't use the compat version
351#define getpid() GetCurrentProcessId()
352#endif
353#endif
354
355/* unistd.h */
356#ifndef HAVE_GETPID
357pid_t getpid (void) VLC_NOTHROW;
358#endif
359
360#ifndef HAVE_FSYNC
361int fsync (int fd);
362#endif
363
364/* dirent.h */
365#ifndef HAVE_DIRFD
366int (dirfd) (DIR *);
367#endif
368
369#ifndef HAVE_FDOPENDIR
370DIR *fdopendir (int);
371#endif
372
373#ifdef __cplusplus
374} /* extern "C" */
375#endif
376
377/* stdlib.h */
378#ifndef HAVE_GETENV
379static inline char *getenv (const char *name)
381 (void)name;
382 return NULL;
383}
384#endif
385
386#ifdef __cplusplus
387extern "C" {
388#endif
389
390#ifndef HAVE_SETENV
391int setenv (const char *, const char *, int);
392int unsetenv (const char *);
393#endif
394
395#ifndef HAVE_POSIX_MEMALIGN
396int posix_memalign(void **, size_t, size_t);
397#endif
398
399#ifndef HAVE_ALIGNED_ALLOC
400void *aligned_alloc(size_t, size_t);
401#endif
402
403#ifdef __cplusplus
404} /* extern "C" */
405#endif
406
407#if defined (_WIN32)
408#define aligned_free(ptr) _aligned_free(ptr)
409#else
410#define aligned_free(ptr) free(ptr)
411#endif
412
413#if !defined(HAVE_NEWLOCALE) && defined(HAVE_CXX_LOCALE_T) && defined(__cplusplus)
414# include <locale>
415# define HAVE_NEWLOCALE
416#endif
417
418/* locale.h */
419#ifndef HAVE_USELOCALE
420# ifndef HAVE_NEWLOCALE
421# define LC_ALL_MASK 0
422# define LC_NUMERIC_MASK 0
423# define LC_MESSAGES_MASK 0
424# define LC_GLOBAL_LOCALE ((locale_t)(uintptr_t)1)
425typedef void *locale_t;
427static inline void freelocale(locale_t loc)
429 (void)loc;
430}
431static inline locale_t newlocale(int mask, const char * locale, locale_t base)
433 (void)mask; (void)locale; (void)base;
434 return NULL;
435}
436# else
437# include <locale.h>
438# endif
439
440static inline locale_t uselocale(locale_t loc)
442 (void)loc;
443 return NULL;
444}
445#endif
446
447/* libintl support */
448#define _(str) vlc_gettext (str)
449#define N_(str) gettext_noop (str)
450#define gettext_noop(str) (str)
452#ifdef __cplusplus
453extern "C" {
454#endif
455
456#ifndef HAVE_SWAB
457/* Android NDK25 have swab but configure fails to detect it */
458#ifndef __ANDROID__
459void swab (const void *, void *, ssize_t);
460#endif
461#endif
462
463/* Socket stuff */
464#ifndef HAVE_INET_PTON
465# ifdef __cplusplus
466}
467# endif
468# ifndef _WIN32
469# include <sys/socket.h>
470#else
471typedef int socklen_t;
472# endif
473# ifdef __cplusplus
474extern "C" {
475# endif
476
477int inet_pton(int, const char *, void *);
478const char *inet_ntop(int, const void *, char *, socklen_t);
479#endif
480
481#ifndef HAVE_STRUCT_POLLFD
482enum
483{
484 POLLERR=0x1,
491 POLLPRI=0x400,
493#define POLLIN (POLLRDNORM|POLLRDBAND)
494#define POLLOUT (POLLWRNORM|POLLWRBAND)
496struct pollfd
498 int fd;
499 short events;
500 short revents;
502#endif
503#ifndef HAVE_POLL
504struct pollfd;
505int poll (struct pollfd *, unsigned, int);
506#endif
507
508#ifndef HAVE_IF_NAMEINDEX
509# ifdef __cplusplus
510}
511# endif
512#include <errno.h>
513# ifdef __cplusplus
514extern "C" {
515# endif
516# ifndef HAVE_STRUCT_IF_NAMEINDEX
517struct if_nameindex
519 unsigned if_index;
520 char *if_name;
522# endif
523# define if_nameindex() (errno = ENOBUFS, NULL)
524# define if_freenameindex(list) (void)0
525#endif
526
527#ifndef HAVE_STRUCT_TIMESPEC
528struct timespec {
529 time_t tv_sec; /* Seconds */
530 long tv_nsec; /* Nanoseconds */
532#endif
533
534#ifdef _WIN32
535struct iovec
536{
537 void *iov_base;
538 size_t iov_len;
539};
540#define IOV_MAX 255
541struct msghdr
542{
543 void *msg_name;
544 size_t msg_namelen;
545 struct iovec *msg_iov;
546 size_t msg_iovlen;
547 void *msg_control;
548 size_t msg_controllen;
549 int msg_flags;
550};
551
552# ifndef HAVE_IF_NAMETOINDEX
553# ifdef __cplusplus
554}
555# endif
556# include <stdlib.h> /* a define may change from the real atoi declaration */
557# ifdef __cplusplus
558extern "C" {
559# endif
560static inline int if_nametoindex(const char *name)
561{
562 return atoi(name);
563}
564# endif
565#endif
566
567#ifdef _NEWLIB_VERSION
568#define IOV_MAX 255
569#endif
570
571#ifndef HAVE_RECVMSG
572struct msghdr;
573ssize_t recvmsg(int, struct msghdr *, int);
574#endif
575
576#ifndef HAVE_SENDMSG
577struct msghdr;
578ssize_t sendmsg(int, const struct msghdr *, int);
579#endif
580
581/* search.h */
582#ifndef HAVE_TFIND
583typedef enum {
588} VISIT;
590void *tsearch( const void *key, void **rootp, int(*cmp)(const void *, const void *) );
591void *tfind( const void *key, void * const *rootp, int(*cmp)(const void *, const void *) );
592void *tdelete( const void *key, void **rootp, int(*cmp)(const void *, const void *) );
593void twalk( const void *root, void(*action)(const void *nodep, VISIT which, int depth) );
594#ifndef _WIN32
595/* the Win32 prototype of lfind() expects an unsigned* for 'nmemb' */
596void *lfind( const void *key, const void *base, size_t *nmemb,
597 size_t size, int(*cmp)(const void *, const void *) );
598#endif
599#endif /* HAVE_TFIND */
600
601#ifndef HAVE_TDESTROY
602void tdestroy( void *root, void (*free_node)(void *nodep) );
603#endif
604
605/* sys/auxv.h */
606#ifndef HAVE_GETAUXVAL
607unsigned long getauxval(unsigned long);
608#endif
609
610/* Random numbers */
611#ifndef HAVE_NRAND48
612double erand48 (unsigned short subi[3]);
613long jrand48 (unsigned short subi[3]);
614long nrand48 (unsigned short subi[3]);
615#endif
616
617#ifdef __OS2__
618# undef HAVE_FORK /* Implementation of fork() is imperfect on OS/2 */
619
620# define SHUT_RD 0
621# define SHUT_WR 1
622# define SHUT_RDWR 2
623
624/* GAI error codes */
625# ifndef EAI_BADFLAGS
626# define EAI_BADFLAGS -1
627# endif
628# ifndef EAI_NONAME
629# define EAI_NONAME -2
630# endif
631# ifndef EAI_AGAIN
632# define EAI_AGAIN -3
633# endif
634# ifndef EAI_FAIL
635# define EAI_FAIL -4
636# endif
637# ifndef EAI_NODATA
638# define EAI_NODATA -5
639# endif
640# ifndef EAI_FAMILY
641# define EAI_FAMILY -6
642# endif
643# ifndef EAI_SOCKTYPE
644# define EAI_SOCKTYPE -7
645# endif
646# ifndef EAI_SERVICE
647# define EAI_SERVICE -8
648# endif
649# ifndef EAI_ADDRFAMILY
650# define EAI_ADDRFAMILY -9
651# endif
652# ifndef EAI_MEMORY
653# define EAI_MEMORY -10
654# endif
655# ifndef EAI_OVERFLOW
656# define EAI_OVERFLOW -11
657# endif
658# ifndef EAI_SYSTEM
659# define EAI_SYSTEM -12
660# endif
661
662# ifndef NI_NUMERICHOST
663# define NI_NUMERICHOST 0x01
664# define NI_NUMERICSERV 0x02
665# define NI_NOFQDN 0x04
666# define NI_NAMEREQD 0x08
667# define NI_DGRAM 0x10
668# endif
669
670# ifndef NI_MAXHOST
671# define NI_MAXHOST 1025
672# define NI_MAXSERV 32
673# endif
674
675# define AI_PASSIVE 1
676# define AI_CANONNAME 2
677# define AI_NUMERICHOST 4
678
679struct addrinfo
680{
681 int ai_flags;
682 int ai_family;
683 int ai_socktype;
684 int ai_protocol;
685 size_t ai_addrlen;
686 struct sockaddr *ai_addr;
687 char *ai_canonname;
688 struct addrinfo *ai_next;
689};
690
691# ifdef __LIBCN__
692/* OS/2 LIBCn has inet_pton(). Because of this, socklen_t is not defined above.
693 * And OS/2 LIBCn has socklen_t. So include sys/socket.h here for socklen_t. */
694# include <sys/socket.h>
695# endif
696
697const char *gai_strerror (int);
698
699int getaddrinfo (const char *node, const char *service,
700 const struct addrinfo *hints, struct addrinfo **res);
701void freeaddrinfo (struct addrinfo *res);
702int getnameinfo (const struct sockaddr *sa, socklen_t salen,
703 char *host, int hostlen, char *serv, int servlen,
704 int flags);
705
706/* OS/2 does not support IPv6, yet. But declare these only for compilation */
707# include <stdint.h>
708
709struct in6_addr
710{
711 uint8_t s6_addr[16];
712};
713
714struct sockaddr_in6
715{
716 uint8_t sin6_len;
717 uint8_t sin6_family;
718 uint16_t sin6_port;
719 uint32_t sin6_flowinfo;
720 struct in6_addr sin6_addr;
721 uint32_t sin6_scope_id;
722};
723
724# define IN6_IS_ADDR_MULTICAST(a) (((__const uint8_t *) (a))[0] == 0xff)
725
726# define INET6_ADDRSTRLEN 46
727
728static const struct in6_addr in6addr_any =
729 { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };
730
731#define IN6ADDR_ANY_INIT \
732 { { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } }
733
734# include <errno.h>
735# ifndef EPROTO
736# define EPROTO (ELAST + 1)
737# endif
738
739# ifndef HAVE_IF_NAMETOINDEX
740# define if_nametoindex(name) atoi(name)
741# endif
742
743/* static_assert missing in assert.h */
744# if defined(__STDC_VERSION__) && \
745 __STDC_VERSION__ >= 201112L && __STDC_VERSION__ < 202311L
746# include <assert.h>
747# ifndef static_assert
748# define static_assert _Static_assert
749# endif
750# endif
751#endif /* __OS2__ */
752
753/* math.h */
754
755#ifndef HAVE_NANF
756#define nanf(tagp) NAN
757#endif
758
759#ifndef HAVE_SINCOS
760void sincos(double, double *, double *);
761void sincosf(float, float *, float *);
762#endif
763
764#ifndef HAVE_REALPATH
765char *realpath(const char * restrict pathname, char * restrict resolved_path);
766#endif
767
768/* mingw-w64 has a broken IN6_IS_ADDR_MULTICAST macro */
769#if defined(_WIN32) && defined(__MINGW64_VERSION_MAJOR)
770# define IN6_IS_ADDR_MULTICAST IN6_IS_ADDR_MULTICAST
771#endif
772
773#ifdef __APPLE__
774# define fdatasync fsync
775
776# ifdef __cplusplus
777}
778# endif
779# include <time.h>
780# ifdef __cplusplus
781extern "C" {
782# endif
783# ifndef TIMER_ABSTIME
784# define TIMER_ABSTIME 0x01
785# endif
786# ifndef CLOCK_REALTIME
787# define CLOCK_REALTIME 0
788# endif
789# ifndef CLOCK_MONOTONIC
790# define CLOCK_MONOTONIC 6
791# endif
792# ifndef HAVE_CLOCK_GETTIME
793int clock_gettime(clockid_t clock_id, struct timespec *tp);
794# endif
795# ifndef HAVE_CLOCK_GETRES
796int clock_getres(clockid_t clock_id, struct timespec *tp);
797# endif
798#endif
799
800#ifndef _WIN32
801# ifndef HAVE_CLOCK_NANOSLEEP
802# ifdef __cplusplus
803}
804# endif
805# include <time.h>
806# ifdef __cplusplus
807extern "C" {
808# endif
809int clock_nanosleep(clockid_t clock_id, int flags,
810 const struct timespec *rqtp, struct timespec *rmtp);
811# endif
812#endif
813
814#ifdef _WIN32
815# if defined(_CRT_INTERNAL_NONSTDC_NAMES) && !_CRT_INTERNAL_NONSTDC_NAMES
816# include <string.h>
817// the MS POSIX aliases are missing
818static inline char *strdup(const char *str)
819{
820 return _strdup(str);
821}
822
823# define O_WRONLY _O_WRONLY
824# define O_CREAT _O_CREAT
825# define O_APPEND _O_APPEND
826# define O_TRUNC _O_TRUNC
827# define O_BINARY _O_BINARY
828# define O_EXCL _O_EXCL
829# define O_RDWR _O_RDWR
830# define O_TEXT _O_TEXT
831# define O_NOINHERIT _O_NOINHERIT
832# define O_RDONLY _O_RDONLY
833
834# endif // !_CRT_INTERNAL_NONSTDC_NAMES
835#endif // _WIN32
836
837
838#ifdef __cplusplus
839} /* extern "C" */
840#endif
841
842#if defined(__cplusplus)
843#ifndef HAVE_CXX_TYPEOF
844# include <type_traits>
845# define typeof(t) std::remove_reference<decltype(t)>::type
846#endif
847#endif
848
849#endif /* !LIBVLC_FIXUPS_H */
const char name[16]
Definition: httpd.c:1281
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:519
unsigned if_index
Definition: vlc_fixups.h:520
char * if_name
Definition: vlc_fixups.h:521
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:498
int fd
Definition: vlc_fixups.h:499
short revents
Definition: vlc_fixups.h:501
short events
Definition: vlc_fixups.h:500
Definition: vlc_fixups.h:529
long tv_nsec
Definition: vlc_fixups.h:531
time_t tv_sec
Definition: vlc_fixups.h:530
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
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:428
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:441
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:380
ssize_t getline(char **, size_t *, FILE *)
static locale_t newlocale(int mask, const char *locale, locale_t base)
Definition: vlc_fixups.h:432
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:426
int poll(struct pollfd *, unsigned, int)
void * tsearch(const void *key, void **rootp, int(*cmp)(const void *, const void *))
@ POLLRDBAND
Definition: vlc_fixups.h:491
@ POLLWRBAND
Definition: vlc_fixups.h:489
@ POLLPRI
Definition: vlc_fixups.h:492
@ POLLRDNORM
Definition: vlc_fixups.h:490
@ POLLHUP
Definition: vlc_fixups.h:486
@ POLLNVAL
Definition: vlc_fixups.h:487
@ POLLWRNORM
Definition: vlc_fixups.h:488
@ POLLERR
Definition: vlc_fixups.h:485
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:584
@ postorder
Definition: vlc_fixups.h:586
@ leaf
Definition: vlc_fixups.h:588
@ endorder
Definition: vlc_fixups.h:587
@ preorder
Definition: vlc_fixups.h:585
int asprintf(char **, const char *,...)
void funlockfile(FILE *)
int getchar_unlocked(void)
char * strsep(char **, const char *)