Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/system/lib/libc/musl/include/features.h
6174 views
1
#ifndef _FEATURES_H
2
#define _FEATURES_H
3
4
#if defined(_ALL_SOURCE) && !defined(_GNU_SOURCE)
5
#define _GNU_SOURCE 1
6
#endif
7
8
#if defined(_DEFAULT_SOURCE) && !defined(_BSD_SOURCE)
9
#define _BSD_SOURCE 1
10
#endif
11
12
#if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) \
13
&& !defined(_XOPEN_SOURCE) && !defined(_GNU_SOURCE) \
14
&& !defined(_BSD_SOURCE) && !defined(__STRICT_ANSI__)
15
#define _BSD_SOURCE 1
16
#define _XOPEN_SOURCE 700
17
#endif
18
19
#if defined(__EMSCRIPTEN__) && defined(_GNU_SOURCE)
20
// In emscripten the LFS functions are kept around when _GNU_SOURCE is
21
// defined, for increased compatabiliy. This is also what glibc does.
22
#undef _LARGEFILE64_SOURCE
23
#define _LARGEFILE64_SOURCE 1
24
#endif
25
26
#if __STDC_VERSION__ >= 199901L
27
#define __restrict restrict
28
#elif !defined(__GNUC__)
29
#define __restrict
30
#endif
31
32
#if __STDC_VERSION__ >= 199901L || defined(__cplusplus)
33
#define __inline inline
34
#elif !defined(__GNUC__)
35
#define __inline
36
#endif
37
38
#if __STDC_VERSION__ >= 201112L
39
#elif defined(__GNUC__)
40
#define _Noreturn __attribute__((__noreturn__))
41
#else
42
#define _Noreturn
43
#endif
44
45
#define __REDIR(x,y) __typeof__(x) x __asm__(#y)
46
47
#endif
48
49