From 03af952060fee063679864d82cdd76f94d56d263 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 6 Aug 2012 16:48:14 -0700 Subject: Clean up lockf64, fseeko64, ftello64, fgetpos64, fsetpos64 for off64_t == off_t. --- libio/fseeko.c | 6 +++++- libio/fseeko64.c | 7 ++++++- libio/ftello.c | 7 +++++-- libio/ftello64.c | 6 ++++-- libio/iofgetpos.c | 20 ++++++++++++++++++-- libio/iofgetpos64.c | 6 ++++-- libio/iofsetpos.c | 20 ++++++++++++++++++-- libio/iofsetpos64.c | 7 +++++-- 8 files changed, 65 insertions(+), 14 deletions(-) (limited to 'libio') diff --git a/libio/fseeko.c b/libio/fseeko.c index 7a70636..6d37aea 100644 --- a/libio/fseeko.c +++ b/libio/fseeko.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,1995,1996,1997,1998,2003 Free Software Foundation, Inc. +/* Copyright (C) 1993-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -40,3 +40,7 @@ fseeko (fp, offset, whence) _IO_release_lock (fp); return result; } + +#ifdef __OFF_T_MATCHES_OFF64_T +weak_alias (fseeko, fseeko64) +#endif diff --git a/libio/fseeko64.c b/libio/fseeko64.c index 2291f61..9fbe308 100644 --- a/libio/fseeko64.c +++ b/libio/fseeko64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,1995,1996,1997,1998,2003 Free Software Foundation, Inc. +/* Copyright (C) 1993-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -28,6 +28,9 @@ #include "libioP.h" #include "stdio.h" +/* fseeko.c defines this as an alias if __OFF_T_MATCHES_OFF64_T. */ +#ifndef __OFF_T_MATCHES_OFF64_T + int fseeko64 (fp, offset, whence) _IO_FILE* fp; @@ -46,3 +49,5 @@ fseeko64 (fp, offset, whence) return -1; #endif } + +#endif diff --git a/libio/ftello.c b/libio/ftello.c index 1d85bc6..9052276 100644 --- a/libio/ftello.c +++ b/libio/ftello.c @@ -1,5 +1,4 @@ -/* Copyright (C) 1993, 1995-2001, 2002, 2003, 2004, 2007 - Free Software Foundation, Inc. +/* Copyright (C) 1993-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -63,3 +62,7 @@ ftello (fp) return pos; } libc_hidden_def (ftello) + +#ifdef __OFF_T_MATCHES_OFF64_T +weak_alias (ftello, ftello64) +#endif diff --git a/libio/ftello64.c b/libio/ftello64.c index 0f70c66..852ef71 100644 --- a/libio/ftello64.c +++ b/libio/ftello64.c @@ -1,5 +1,4 @@ -/* Copyright (C) 1993, 1995-2001, 2002, 2003, 2004 - Free Software Foundation, Inc. +/* Copyright (C) 1993-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -30,6 +29,7 @@ #include #include +#ifndef __OFF_T_MATCHES_OFF64_T off64_t ftello64 (fp) @@ -60,3 +60,5 @@ ftello64 (fp) return -1; #endif } + +#endif diff --git a/libio/iofgetpos.c b/libio/iofgetpos.c index 4338b50..a1d6bb6 100644 --- a/libio/iofgetpos.c +++ b/libio/iofgetpos.c @@ -1,5 +1,4 @@ -/* Copyright (C) 1993, 1995-2001, 2002, 2003, 2004 - Free Software Foundation, Inc. +/* Copyright (C) 1993-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -25,7 +24,17 @@ This exception applies to code released by its copyright holders in files containing the exception. */ +/* We need to avoid the header declarations of these, because + the types don't match _IO_fgetpos and then the compiler will + complain about the mismatch when we do the alias below. */ +#define _IO_new_fgetpos64 __renamed__IO_new_fgetpos64 +#define _IO_fgetpos64 __renamed__IO_fgetpos64 + #include "libioP.h" + +#undef _IO_new_fgetpos64 +#undef _IO_fgetpos64 + #include #include #include @@ -78,3 +87,10 @@ _IO_new_fgetpos (fp, posp) strong_alias (_IO_new_fgetpos, __new_fgetpos) versioned_symbol (libc, _IO_new_fgetpos, _IO_fgetpos, GLIBC_2_2); versioned_symbol (libc, __new_fgetpos, fgetpos, GLIBC_2_2); + +#ifdef __OFF_T_MATCHES_OFF64_T +strong_alias (_IO_new_fgetpos, _IO_new_fgetpos64) +strong_alias (_IO_new_fgetpos64, __new_fgetpos64) +versioned_symbol (libc, _IO_new_fgetpos64, _IO_fgetpos64, GLIBC_2_2); +versioned_symbol (libc, __new_fgetpos64, fgetpos64, GLIBC_2_2); +#endif diff --git a/libio/iofgetpos64.c b/libio/iofgetpos64.c index 0cb141b..9755c32 100644 --- a/libio/iofgetpos64.c +++ b/libio/iofgetpos64.c @@ -1,5 +1,4 @@ -/* Copyright (C) 1993, 1995-2001, 2002, 2003, 2004 - Free Software Foundation, Inc. +/* Copyright (C) 1993-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -29,6 +28,7 @@ #include #include +#ifndef __OFF_T_MATCHES_OFF64_T int _IO_new_fgetpos64 (fp, posp) @@ -75,3 +75,5 @@ _IO_new_fgetpos64 (fp, posp) strong_alias (_IO_new_fgetpos64, __new_fgetpos64) versioned_symbol (libc, _IO_new_fgetpos64, _IO_fgetpos64, GLIBC_2_2); versioned_symbol (libc, __new_fgetpos64, fgetpos64, GLIBC_2_2); + +#endif diff --git a/libio/iofsetpos.c b/libio/iofsetpos.c index 19bea3b..5e8d444 100644 --- a/libio/iofsetpos.c +++ b/libio/iofsetpos.c @@ -1,5 +1,4 @@ -/* Copyright (C) 1993, 1995, 1997, 1998, 1999, 2000, 2002, 2003 - Free Software Foundation, Inc. +/* Copyright (C) 1993-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -25,7 +24,17 @@ This exception applies to code released by its copyright holders in files containing the exception. */ +/* We need to avoid the header declarations of these, because + the types don't match _IO_fsetpos and then the compiler will + complain about the mismatch when we do the alias below. */ +#define _IO_new_fsetpos64 __renamed__IO_new_fsetpos64 +#define _IO_fsetpos64 __renamed__IO_fsetpos64 + #include + +#undef _IO_new_fsetpos64 +#undef _IO_fsetpos64 + #include #include @@ -63,3 +72,10 @@ _IO_new_fsetpos (fp, posp) strong_alias (_IO_new_fsetpos, __new_fsetpos) versioned_symbol (libc, _IO_new_fsetpos, _IO_fsetpos, GLIBC_2_2); versioned_symbol (libc, __new_fsetpos, fsetpos, GLIBC_2_2); + +#ifdef __OFF_T_MATCHES_OFF64_T +strong_alias (_IO_new_fsetpos, _IO_new_fsetpos64) +strong_alias (_IO_new_fsetpos64, __new_fsetpos64) +versioned_symbol (libc, __new_fsetpos64, fsetpos64, GLIBC_2_2); +versioned_symbol (libc, _IO_new_fsetpos64, _IO_fsetpos64, GLIBC_2_2); +#endif diff --git a/libio/iofsetpos64.c b/libio/iofsetpos64.c index 9835c12..20edd8d 100644 --- a/libio/iofsetpos64.c +++ b/libio/iofsetpos64.c @@ -1,5 +1,4 @@ -/* Copyright (C) 1993, 1995, 1997, 1998, 1999, 2000, 2002, 2003 - Free Software Foundation, Inc. +/* Copyright (C) 1993-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -29,6 +28,8 @@ #include #include +#ifndef __OFF_T_MATCHES_OFF64_T + int _IO_new_fsetpos64 (fp, posp) _IO_FILE *fp; @@ -68,3 +69,5 @@ _IO_new_fsetpos64 (fp, posp) strong_alias (_IO_new_fsetpos64, __new_fsetpos64) versioned_symbol (libc, __new_fsetpos64, fsetpos64, GLIBC_2_2); versioned_symbol (libc, _IO_new_fsetpos64, _IO_fsetpos64, GLIBC_2_2); + +#endif -- cgit v1.1