]>
Commit | Line | Data |
---|---|---|
d3b450f3 CV |
1 | /* cygwin/config.h header file for Cygwin. |
2 | ||
3 | This wraps Cygwin configuration setting which were in newlib's | |
ade47a34 | 4 | sys/config.h before. This way we can manaage our configuration |
d3b450f3 | 5 | setting without bothering newlib. |
d3b450f3 CV |
6 | Written by C. Vinschen. |
7 | ||
8 | This file is part of Cygwin. | |
9 | ||
10 | This software is a copyrighted work licensed under the terms of the | |
11 | Cygwin license. Please consult the file "CYGWIN_LICENSE" for | |
12 | details. */ | |
13 | ||
14 | #ifndef _CYGWIN_CONFIG_H | |
15 | #ifdef __cplusplus | |
16 | extern "C" { | |
17 | #endif | |
18 | #define _CYGWIN_CONFIG_H | |
19 | ||
c433f461 | 20 | #define __DYNAMIC_REENT__ |
6e08b2f7 BD |
21 | |
22 | /* The following provides an inline version of __getreent() for newlib, | |
23 | which will be used throughout the library whereever there is a _r | |
24 | version of a function that takes _REENT. This saves the overhead | |
25 | of a function call for what amounts to a simple computation. | |
70300fdb | 26 | |
d4fa3b4a CV |
27 | This is the allocation size of the TLS area on the stack. Parts of |
28 | the stack are in use by the OS, so we need to go a bit higher than | |
29 | what's actually required by the cygtls struct. The _reent struct is | |
30 | right at the beginning of struct cygtls and always has to be. */ | |
31 | #define __CYGTLS_PADSIZE__ 12800 /* Must be 16-byte aligned */ | |
6e08b2f7 | 32 | |
6226bad0 | 33 | #if defined (_LIBC) || defined (__INSIDE_CYGWIN__) |
d4fa3b4a | 34 | |
7b3d8b94 | 35 | __attribute__((__gnu_inline__)) |
3bbc40af | 36 | extern inline struct _reent *__getreent (void) |
61522196 CV |
37 | { |
38 | register char *ret; | |
bbfe79fb | 39 | #ifdef __x86_64__ |
61522196 | 40 | __asm __volatile__ ("movq %%gs:8,%0" : "=r" (ret)); |
bbfe79fb KB |
41 | #else |
42 | #error unimplemented for this target | |
43 | #endif | |
d4fa3b4a | 44 | return (struct _reent *) (ret - __CYGTLS_PADSIZE__); |
7b0c063f | 45 | } |
6226bad0 | 46 | #endif /* _LIBC || __INSIDE_CYGWIN__ */ |
6e08b2f7 | 47 | |
e1ce752a | 48 | #define _SYMSTR(x) #x |
61522196 | 49 | |
3db08eee | 50 | #define __FILENAME_MAX__ 4096 /* Keep in sync with PATH_MAX in limits.h. */ |
627ef695 CV |
51 | |
52 | /* The following block of macros is required to build newlib correctly for | |
53 | Cygwin. Changing them in applications has no or not the desired effect. | |
54 | Just leave them alone. */ | |
d3b450f3 | 55 | #define _READ_WRITE_RETURN_TYPE _ssize_t |
15850801 | 56 | #define _READ_WRITE_BUFSIZE_TYPE size_t |
627ef695 CV |
57 | #define __LINUX_ERRNO_EXTENSIONS__ 1 |
58 | #define _MB_EXTENDED_CHARSETS_ALL 1 | |
59 | #define __HAVE_LOCALE_INFO__ 1 | |
be764ea8 | 60 | #define __HAVE_LOCALE_INFO_EXTENDED__ 1 |
627ef695 | 61 | #define _WANT_C99_TIME_FORMATS 1 |
e5556464 | 62 | #define _GLIBC_EXTENSION 1 |
5780e35a | 63 | #define _STDIO_BSD_SEMANTICS 1 |
512ecab4 CV |
64 | #define __TM_GMTOFF tm_gmtoff |
65 | #define __TM_ZONE tm_zone | |
4de8754b | 66 | #define _USE_LONG_TIME_T 1 |
4a00cbce | 67 | #define _REENT_BACKWARD_BINARY_COMPAT 1 |
512ecab4 | 68 | |
6226bad0 | 69 | #if defined(__INSIDE_CYGWIN__) || defined(_LIBC) |
a33fa76f | 70 | #define __EXPORT __declspec(dllexport) |
d3b450f3 CV |
71 | #define __IMPORT |
72 | #else | |
a33fa76f | 73 | #define __EXPORT |
d3b450f3 CV |
74 | #define __IMPORT __declspec(dllimport) |
75 | #endif | |
76 | ||
77 | #ifndef __WCHAR_MAX__ | |
78 | #define __WCHAR_MAX__ 0xffffu | |
79 | #endif | |
80 | ||
1441f6a3 CV |
81 | #define DEFAULT_LOCALE "C.UTF-8" |
82 | ||
d3b450f3 CV |
83 | #ifdef __cplusplus |
84 | } | |
85 | #endif | |
86 | #endif /* _CYGWIN_CONFIG_H */ |