]>
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 CV |
5 | setting without bothering newlib. |
6 | ||
bc837d22 | 7 | Copyright 2003, 2007, 2008, 2009, 2010, 2012 Red Hat, Inc. |
d3b450f3 CV |
8 | Written by C. Vinschen. |
9 | ||
10 | This file is part of Cygwin. | |
11 | ||
12 | This software is a copyrighted work licensed under the terms of the | |
13 | Cygwin license. Please consult the file "CYGWIN_LICENSE" for | |
14 | details. */ | |
15 | ||
16 | #ifndef _CYGWIN_CONFIG_H | |
17 | #ifdef __cplusplus | |
18 | extern "C" { | |
19 | #endif | |
20 | #define _CYGWIN_CONFIG_H | |
21 | ||
c433f461 | 22 | #define __DYNAMIC_REENT__ |
6e08b2f7 BD |
23 | |
24 | /* The following provides an inline version of __getreent() for newlib, | |
25 | which will be used throughout the library whereever there is a _r | |
26 | version of a function that takes _REENT. This saves the overhead | |
27 | of a function call for what amounts to a simple computation. | |
70300fdb | 28 | |
6e08b2f7 BD |
29 | The definition below is essentially equivalent to the one in cygtls.h |
30 | (&_my_tls.local_clib) however it uses a fixed precomputed | |
31 | offset rather than dereferencing a field of a structure. | |
70300fdb | 32 | |
6e08b2f7 BD |
33 | Including tlsoffets.h here in order to get this constant offset |
34 | tls_local_clib is a bit of a hack, but the alternative would require | |
35 | dragging the entire definition of struct _cygtls (a large and complex | |
36 | Cygwin internal data structure) into newlib. The machinery to | |
37 | compute these offsets already exists for the sake of gendef so | |
38 | we might as well just use it here. */ | |
39 | ||
1515ce29 | 40 | #ifdef _COMPILING_NEWLIB |
6e08b2f7 BD |
41 | #include "../tlsoffsets.h" |
42 | extern char *_tlsbase __asm__ ("%fs:4"); | |
43 | #define __getreent() (struct _reent *)(_tlsbase + tls_local_clib) | |
1515ce29 | 44 | #endif /* _COMPILING_NEWLIB */ |
6e08b2f7 | 45 | |
3db08eee | 46 | #define __FILENAME_MAX__ 4096 /* Keep in sync with PATH_MAX in limits.h. */ |
627ef695 CV |
47 | |
48 | /* The following block of macros is required to build newlib correctly for | |
49 | Cygwin. Changing them in applications has no or not the desired effect. | |
50 | Just leave them alone. */ | |
d3b450f3 CV |
51 | #define _READ_WRITE_RETURN_TYPE _ssize_t |
52 | #define __LARGE64_FILES 1 | |
5d575f7d | 53 | #define __USE_INTERNAL_STAT64 1 |
627ef695 CV |
54 | #define __LINUX_ERRNO_EXTENSIONS__ 1 |
55 | #define _MB_EXTENDED_CHARSETS_ALL 1 | |
56 | #define __HAVE_LOCALE_INFO__ 1 | |
be764ea8 | 57 | #define __HAVE_LOCALE_INFO_EXTENDED__ 1 |
627ef695 | 58 | #define _WANT_C99_TIME_FORMATS 1 |
e5556464 | 59 | #define _GLIBC_EXTENSION 1 |
d3b450f3 | 60 | #if defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB) |
a33fa76f | 61 | #define __EXPORT __declspec(dllexport) |
d3b450f3 CV |
62 | #define __IMPORT |
63 | #else | |
a33fa76f | 64 | #define __EXPORT |
d3b450f3 CV |
65 | #define __IMPORT __declspec(dllimport) |
66 | #endif | |
67 | ||
68 | #ifndef __WCHAR_MAX__ | |
69 | #define __WCHAR_MAX__ 0xffffu | |
70 | #endif | |
71 | ||
1441f6a3 CV |
72 | #define DEFAULT_LOCALE "C.UTF-8" |
73 | ||
d3b450f3 CV |
74 | #ifdef __cplusplus |
75 | } | |
76 | #endif | |
77 | #endif /* _CYGWIN_CONFIG_H */ |