diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2022-12-08 13:58:37 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2022-12-08 13:58:37 +0100 |
commit | 0f376ae22036bac2fbc7863264909b599e42616c (patch) | |
tree | fef60a2c01f9c94e8e7ebd44c7c14d488a291853 /winsup | |
parent | 53ea7b2d5a3858e18b1615090701fa5bd0e28965 (diff) | |
download | newlib-0f376ae22036bac2fbc7863264909b599e42616c.zip newlib-0f376ae22036bac2fbc7863264909b599e42616c.tar.gz newlib-0f376ae22036bac2fbc7863264909b599e42616c.tar.bz2 |
Cygwin: rename __sFILE to __sFILE64 for backward compatibility
Until Cygwin 3.3.6, we define __LARGE64_FILES unconditionally, so we
were using the type __sFILE64 even for 64 bit. That was lazy and wrong.
so commit 2902b3a09e0a ("Cygwin: drop requirement to build newlib's
stdio64") tried to fix that.
Unfortunately this patch forgot to take the exposure of the typename
__sFILE64 in userspace into account. This leads to trouble in C++ due
to name mangling.
Fix this by redefining __sFILE to __sFILE64. The type name is very much
internal, so it doesn't really matter, except for the fact that it needs
to stay backward compatible so as not to break building against C++ libs
built under older versions of Cygwin.
Fixes: 2902b3a09e0a ("Cygwin: drop requirement to build newlib's stdio64")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/include/cygwin/config.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/winsup/cygwin/include/cygwin/config.h b/winsup/cygwin/include/cygwin/config.h index 2a70832..c9c3565 100644 --- a/winsup/cygwin/include/cygwin/config.h +++ b/winsup/cygwin/include/cygwin/config.h @@ -49,6 +49,12 @@ extern inline struct _reent *__getreent (void) #define __FILENAME_MAX__ 4096 /* Keep in sync with PATH_MAX in limits.h. */ +/* Unfortunately we defined __LARGE64_FILES until Cygwin 3.3.6, so + FILE was based on `struct __sFILE64'. The name is exposed into + userspace and consequentially used in C++ name mangling. We must + redefine __sFILE as __sFILE64 to stay backward compatible. */ +#define __sFILE __sFILE64 + /* 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. */ |