2003-05-09 23:27:40 +02:00
|
|
|
/* cygwin/config.h header file for Cygwin.
|
|
|
|
|
|
|
|
This wraps Cygwin configuration setting which were in newlib's
|
2008-04-07 18:15:45 +02:00
|
|
|
sys/config.h before. This way we can manaage our configuration
|
2003-05-09 23:27:40 +02:00
|
|
|
setting without bothering newlib.
|
|
|
|
Written by C. Vinschen.
|
|
|
|
|
|
|
|
This file is part of Cygwin.
|
|
|
|
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
|
|
|
#ifndef _CYGWIN_CONFIG_H
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
#define _CYGWIN_CONFIG_H
|
|
|
|
|
2003-06-16 05:24:13 +02:00
|
|
|
#define __DYNAMIC_REENT__
|
2007-09-07 02:44:27 +02:00
|
|
|
|
|
|
|
/* The following provides an inline version of __getreent() for newlib,
|
|
|
|
which will be used throughout the library whereever there is a _r
|
|
|
|
version of a function that takes _REENT. This saves the overhead
|
|
|
|
of a function call for what amounts to a simple computation.
|
2008-02-15 18:53:11 +01:00
|
|
|
|
2007-09-07 02:44:27 +02:00
|
|
|
The definition below is essentially equivalent to the one in cygtls.h
|
|
|
|
(&_my_tls.local_clib) however it uses a fixed precomputed
|
|
|
|
offset rather than dereferencing a field of a structure.
|
2008-02-15 18:53:11 +01:00
|
|
|
|
2007-09-07 02:44:27 +02:00
|
|
|
Including tlsoffets.h here in order to get this constant offset
|
|
|
|
tls_local_clib is a bit of a hack, but the alternative would require
|
|
|
|
dragging the entire definition of struct _cygtls (a large and complex
|
|
|
|
Cygwin internal data structure) into newlib. The machinery to
|
|
|
|
compute these offsets already exists for the sake of gendef so
|
|
|
|
we might as well just use it here. */
|
|
|
|
|
2016-08-20 16:03:14 +02:00
|
|
|
#if defined (_COMPILING_NEWLIB) || defined (__INSIDE_CYGWIN__)
|
2013-04-23 11:44:36 +02:00
|
|
|
#ifdef __x86_64__
|
|
|
|
#include "../tlsoffsets64.h"
|
2015-12-02 12:11:06 +01:00
|
|
|
#else
|
|
|
|
#include "../tlsoffsets.h"
|
|
|
|
#endif
|
2017-08-17 03:39:18 +02:00
|
|
|
__attribute__((__gnu_inline__))
|
2016-08-18 14:26:42 +02:00
|
|
|
extern inline struct _reent *__getreent (void)
|
2013-04-23 11:44:36 +02:00
|
|
|
{
|
|
|
|
register char *ret;
|
2015-12-02 12:11:06 +01:00
|
|
|
#ifdef __x86_64__
|
2013-04-23 11:44:36 +02:00
|
|
|
__asm __volatile__ ("movq %%gs:8,%0" : "=r" (ret));
|
|
|
|
#else
|
2015-12-02 12:11:06 +01:00
|
|
|
__asm __volatile__ ("movl %%fs:4,%0" : "=r" (ret));
|
2013-04-23 11:44:36 +02:00
|
|
|
#endif
|
2015-12-02 12:11:06 +01:00
|
|
|
return (struct _reent *) (ret + tls_local_clib);
|
|
|
|
}
|
2016-08-20 16:03:14 +02:00
|
|
|
#endif /* _COMPILING_NEWLIB || __INSIDE_CYGWIN__ */
|
2007-09-07 02:44:27 +02:00
|
|
|
|
2013-04-23 11:44:36 +02:00
|
|
|
#ifdef __x86_64__
|
|
|
|
# define __SYMBOL_PREFIX
|
|
|
|
#else
|
|
|
|
# define __SYMBOL_PREFIX "_"
|
|
|
|
#endif
|
|
|
|
#define _SYMSTR(x) __SYMBOL_PREFIX #x
|
|
|
|
|
2008-06-21 22:24:45 +02:00
|
|
|
#define __FILENAME_MAX__ 4096 /* Keep in sync with PATH_MAX in limits.h. */
|
2010-02-26 10:36:21 +01:00
|
|
|
|
|
|
|
/* The following block of macros is required to build newlib correctly for
|
|
|
|
Cygwin. Changing them in applications has no or not the desired effect.
|
|
|
|
Just leave them alone. */
|
2003-05-09 23:27:40 +02:00
|
|
|
#define _READ_WRITE_RETURN_TYPE _ssize_t
|
2013-10-23 12:06:17 +02:00
|
|
|
#define _READ_WRITE_BUFSIZE_TYPE size_t
|
2003-05-09 23:27:40 +02:00
|
|
|
#define __LARGE64_FILES 1
|
2003-05-13 11:26:17 +02:00
|
|
|
#define __USE_INTERNAL_STAT64 1
|
2010-02-26 10:36:21 +01:00
|
|
|
#define __LINUX_ERRNO_EXTENSIONS__ 1
|
|
|
|
#define _MB_EXTENDED_CHARSETS_ALL 1
|
|
|
|
#define __HAVE_LOCALE_INFO__ 1
|
2010-04-28 12:00:24 +02:00
|
|
|
#define __HAVE_LOCALE_INFO_EXTENDED__ 1
|
2010-02-26 10:36:21 +01:00
|
|
|
#define _WANT_C99_TIME_FORMATS 1
|
2012-01-13 10:15:22 +01:00
|
|
|
#define _GLIBC_EXTENSION 1
|
2014-01-17 11:56:25 +01:00
|
|
|
#define _STDIO_BSD_SEMANTICS 1
|
2014-03-05 13:50:29 +01:00
|
|
|
#define __TM_GMTOFF tm_gmtoff
|
|
|
|
#define __TM_ZONE tm_zone
|
2017-09-07 08:24:22 +02:00
|
|
|
#define _USE_LONG_TIME_T 1
|
2014-03-05 13:50:29 +01:00
|
|
|
|
2003-05-09 23:27:40 +02:00
|
|
|
#if defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB)
|
2009-03-31 11:42:58 +02:00
|
|
|
#define __EXPORT __declspec(dllexport)
|
2003-05-09 23:27:40 +02:00
|
|
|
#define __IMPORT
|
|
|
|
#else
|
2009-03-31 11:42:58 +02:00
|
|
|
#define __EXPORT
|
2003-05-09 23:27:40 +02:00
|
|
|
#define __IMPORT __declspec(dllimport)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __WCHAR_MAX__
|
|
|
|
#define __WCHAR_MAX__ 0xffffu
|
|
|
|
#endif
|
|
|
|
|
2009-10-09 10:36:21 +02:00
|
|
|
#define DEFAULT_LOCALE "C.UTF-8"
|
|
|
|
|
2003-05-09 23:27:40 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* _CYGWIN_CONFIG_H */
|