1 /* cygwin/config.h header file for Cygwin.
3 This wraps Cygwin configuration setting which were in newlib's
4 sys/config.h before. This way we can manaage our configuration
5 setting without bothering newlib.
7 Copyright 2003, 2007, 2008, 2009, 2010 Red Hat, Inc.
8 Written by C. Vinschen.
10 This file is part of Cygwin.
12 This software is a copyrighted work licensed under the terms of the
13 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
16 #ifndef _CYGWIN_CONFIG_H
20 #define _CYGWIN_CONFIG_H
22 #define __DYNAMIC_REENT__
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.
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.
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. */
40 #ifdef _COMPILING_NEWLIB
41 #include "../tlsoffsets.h"
42 extern char *_tlsbase __asm__ ("%fs:4");
43 #define __getreent() (struct _reent *)(_tlsbase + tls_local_clib)
44 #endif /* _COMPILING_NEWLIB */
46 #define __FILENAME_MAX__ 4096 /* Keep in sync with PATH_MAX in limits.h. */
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. */
51 #define _READ_WRITE_RETURN_TYPE _ssize_t
52 #define __LARGE64_FILES 1
53 #define __USE_INTERNAL_STAT64 1
54 #define __LINUX_ERRNO_EXTENSIONS__ 1
55 #define _MB_EXTENDED_CHARSETS_ALL 1
56 #define __HAVE_LOCALE_INFO__ 1
57 #define __HAVE_LOCALE_INFO_EXTENDED__ 1
58 #define _WANT_C99_TIME_FORMATS 1
59 #define _GLIBC_EXTENSION 1
60 #if defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB)
61 #define __EXPORT __declspec(dllexport)
65 #define __IMPORT __declspec(dllimport)
69 #define __WCHAR_MAX__ 0xffffu
72 #define DEFAULT_LOCALE "C.UTF-8"
77 #endif /* _CYGWIN_CONFIG_H */