aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/mingw/def-include/func.def.in
blob: 1d542a1f47a7b6f20c8fb0966344e05af89881f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#ifndef FUNC_DEF_IN
#define FUNC_DEF_IN

// F32         - function available on all 32 bit architectures
// F64         - function available on all 64 bit architectures
// F_X86_ANY   - function available on i386 and x86_64
// F_I386      - function available only on i386
// F_X64       - function available only on x86_64
// F_ARM32     - function available only on arm32
// F_ARM64     - function available only on arm64
// F_ARM_ANY   - function available on 32 and 64 bit arm
// F_NON_I386  - function available on everything but i386
// F_NON_X64   - function available on everything but x86_64
// F_NON_ARM64 - function available on everything but arm64
#if defined(__x86_64__)
#define F64(x) x
#define F_X64(x) x
#define F_X86_ANY(x) x
#define F_NON_I386(x) x
#define F_NON_ARM64(x) x
#elif defined(__i386__)
#define F32(x) x
#define F_I386(x) x
#define F_X86_ANY(x) x
#define F_NON_X64(x) x
#define F_NON_ARM64(x) x
#elif defined(__arm__)
#define F32(x) x
#define F_ARM32(x) x
#define F_ARM_ANY(x) x
#define F_NON_I386(x) x
#define F_NON_X64(x) x
#define F_NON_ARM64(x) x
#elif defined(__aarch64__)
#define F64(x) x
#define F_ARM64(x) x
#define F_ARM_ANY(x) x
#define F_NON_I386(x) x
#define F_NON_X64(x) x
#else
#error No DEF_<ARCH> is defined
#endif

#ifndef F32
#define F32(x)
#endif
#ifndef F64
#define F64(x)
#endif
#ifndef F_X86_ANY
#define F_X86_ANY(x)
#endif
#ifndef F_I386
#define F_I386(x)
#endif
#ifndef F_X64
#define F_X64(x)
#endif
#ifndef F_ARM_ANY
#define F_ARM_ANY(x)
#endif
#ifndef F_ARM32
#define F_ARM32(x)
#endif
#ifndef F_ARM64
#define F_ARM64(x)
#endif
#ifndef F_NON_I386
#define F_NON_I386(x)
#endif
#ifndef F_NON_X64
#define F_NON_X64(x)
#endif
#ifndef F_NON_ARM64
#define F_NON_ARM64(x)
#endif

#if defined(__i386__)
#define STDCALL_DECORATED_EXPORT(symbol) symbol == _ ## symbol
#define FASTCALL_DECORATED_EXPORT(symbol) symbol == symbol
#endif

#if __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__
#define F_LD64(x) x
#define F_LD80(x)
#else
#define F_LD64(x)
#define F_LD80(x) x
#endif

#endif // FUNC_DEF_IN