Debian Codegraph @

rpython/translator/c/src/precommondefs.h

raw symbols SCIP
1 /***** Start of precommondefs.h *****/
2
3 /* This is extracted from pyconfig.h from CPython. It sets the macros
4 that affect the features we get from system include files.
5 It must not #include anything. */
6
7 #ifndef __PYPY_PRECOMMONDEFS_H
8 #define __PYPY_PRECOMMONDEFS_H
9
10
11 /* Define on Darwin to activate all library features */
12 #define _DARWIN_C_SOURCE 1
13 /* These must be set to 64 to enable large file support on 32-bit systems. */
14 #if defined(i386) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(__arm__)
15 #define _FILE_OFFSET_BITS 64
16 #define _LARGEFILE_SOURCE 1
17 #endif
18 /* Define on Linux to activate all library features */
19 #define _GNU_SOURCE 1
20 /* Define on NetBSD to activate all library features */
21 #define _NETBSD_SOURCE 1
22 /* Define to activate features from IEEE Stds 1003.1-2008, except on
23 macOS where it hides a lot symbols */
24 #ifndef __APPLE__
25 # ifndef _POSIX_C_SOURCE
26 # define _POSIX_C_SOURCE 200809L
27 # endif
28 #endif
29 /* Define on FreeBSD to activate all library features */
30 #define __BSD_VISIBLE 1
31 #define __XSI_VISIBLE 700
32 /* Windows: winsock/winsock2 mess */
33 #define WIN32_LEAN_AND_MEAN
34 #ifdef _WIN64
35 typedef __int64 Signed;
36 typedef unsigned __int64 Unsigned;
37 # define SIGNED_MIN LLONG_MIN
38 #else
39 typedef long Signed;
40 typedef unsigned long Unsigned;
41 # define SIGNED_MIN LONG_MIN
42 #endif
43
44 #if !defined(RPY_ASSERT) && !defined(RPY_LL_ASSERT)
45 # define NDEBUG
46 #endif
47
48
49 /* All functions and global variables declared anywhere should use
50 one of the following attributes:
51
52 RPY_EXPORTED: the symbol is exported out of libpypy-c.so.
53
54 RPY_EXTERN: the symbol is not exported out of libpypy-c.so, but
55 otherwise works like 'extern' by being available to
56 other C sources.
57
58 static: as usual, this means the symbol is local to this C file.
59
60 Don't use _RPY_HIDDEN directly. For tests involving building a custom
61 .so, translator/tool/cbuild.py overrides RPY_EXTERN so that it becomes
62 equal to RPY_EXPORTED.
63
64 Any function or global variable declared with no attribute at all is
65 a bug; please report or fix it.
66 */
67 #ifdef __GNUC__
68 # define RPY_EXPORTED extern __attribute__((visibility("default")))
69 # define _RPY_HIDDEN __attribute__((visibility("hidden")))
70 # define RPY_UNUSED __attribute__ ((__unused__))
71 #else
72 # define RPY_EXPORTED extern __declspec(dllexport)
73 # define _RPY_HIDDEN /* nothing */
74 # define RPY_UNUSED /*nothing */
75 #endif
76 #ifndef RPY_EXTERN
77 # define RPY_EXTERN extern _RPY_HIDDEN
78 #endif
79
80 #if defined(_MSC_VER)
81 #define INLINE __inline
82 #elif defined(__GNUC__)
83 #define INLINE __inline__
84 #else
85 #error define inline for this compiler
86 #endif
87
88 #endif /* __PYPY_PRECOMMONDEFS_H */
89
90 /***** End of precommondefs.h *****/