From 8e49df1d656c393e913b6c9343f491c59bd527b2 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 6 Aug 2012 16:47:58 -0700 Subject: Clean up {alphasort,versionsort,scandir,scandirat}{,64} for struct dirent == struct dirent64. --- dirent/alphasort.c | 14 +++++++++++++- dirent/alphasort64.c | 7 ++++++- dirent/scandir.c | 15 +++++++++++++-- dirent/scandir64.c | 7 ++++++- dirent/scandirat.c | 15 +++++++++++++-- dirent/scandirat64.c | 7 ++++++- dirent/versionsort.c | 14 +++++++++++++- dirent/versionsort64.c | 7 ++++++- 8 files changed, 76 insertions(+), 10 deletions(-) (limited to 'dirent') diff --git a/dirent/alphasort.c b/dirent/alphasort.c index 5939322..6fab7f8 100644 --- a/dirent/alphasort.c +++ b/dirent/alphasort.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1997, 1998, 2009 Free Software Foundation, Inc. +/* Copyright (C) 1992-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 @@ -15,7 +15,15 @@ License along with the GNU C Library; if not, see . */ +/* We need to avoid the header declaration of alphasort64, because + the types don't match alphasort and then the compiler will + complain about the mismatch when we do the alias below. */ +#define alphasort64 __renamed_alphasort64 + #include + +#undef alphasort64 + #include int @@ -23,3 +31,7 @@ alphasort (const struct dirent **a, const struct dirent **b) { return strcoll ((*a)->d_name, (*b)->d_name); } + +#ifdef _DIRENT_MATCHES_DIRENT64 +weak_alias (alphasort, alphasort64) +#endif diff --git a/dirent/alphasort64.c b/dirent/alphasort64.c index 4f5c1dd..a4d37ab 100644 --- a/dirent/alphasort64.c +++ b/dirent/alphasort64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1997, 1998, 2000, 2009 Free Software Foundation, Inc. +/* Copyright (C) 1992-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 @@ -18,8 +18,13 @@ #include #include +/* alphasort.c defines alphasort64 as an alias if _DIRENT_MATCHES_DIRENT64. */ +#ifndef _DIRENT_MATCHES_DIRENT64 + int alphasort64 (const struct dirent64 **a, const struct dirent64 **b) { return strcoll ((*a)->d_name, (*b)->d_name); } + +#endif diff --git a/dirent/scandir.c b/dirent/scandir.c index 8b0a87b..6dce54d 100644 --- a/dirent/scandir.c +++ b/dirent/scandir.c @@ -1,5 +1,4 @@ -/* Copyright (C) 1992-1998,2000,2002,2003,2009,2011 - Free Software Foundation, Inc. +/* Copyright (C) 1992-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 @@ -16,7 +15,15 @@ License along with the GNU C Library; if not, see . */ +/* We need to avoid the header declaration of scandir64, because + the types don't match scandir and then the compiler will + complain about the mismatch when we do the alias below. */ +#define scandir64 __renamed_scandir64 + #include + +#undef scandir64 + #include #ifndef SCANDIR @@ -35,3 +42,7 @@ SCANDIR (dir, namelist, select, cmp) { return SCANDIRAT (AT_FDCWD, dir, namelist, select, cmp); } + +#ifdef _DIRENT_MATCHES_DIRENT64 +weak_alias (scandir, scandir64) +#endif diff --git a/dirent/scandir64.c b/dirent/scandir64.c index 78ac570..bba302f 100644 --- a/dirent/scandir64.c +++ b/dirent/scandir64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2009, 2011 Free Software Foundation, Inc. +/* Copyright (C) 2000-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 @@ -17,8 +17,13 @@ #include +/* scandir.c defines scandir64 as an alias if _DIRENT_MATCHES_DIRENT64. */ +#ifndef _DIRENT_MATCHES_DIRENT64 + #define SCANDIR scandir64 #define SCANDIRAT scandirat64 #define DIRENT_TYPE struct dirent64 #include + +#endif diff --git a/dirent/scandirat.c b/dirent/scandirat.c index 13bd574..c2704ba 100644 --- a/dirent/scandirat.c +++ b/dirent/scandirat.c @@ -1,5 +1,4 @@ -/* Copyright (C) 1992-1998,2000,2002,2003,2009,2011 - Free Software Foundation, Inc. +/* Copyright (C) 1992-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 @@ -16,7 +15,15 @@ License along with the GNU C Library; if not, see . */ +/* We need to avoid the header declaration of scandir64, because + the types don't match scandir and then the compiler will + complain about the mismatch when we do the alias below. */ +#define scandirat64 __renamed_scandirat64 + #include + +#undef scandirat64 + #include #include #include @@ -141,3 +148,7 @@ SCANDIRAT (dfd, dir, namelist, select, cmp) return c.cnt; } libc_hidden_def (SCANDIRAT) + +#ifdef _DIRENT_MATCHES_DIRENT64 +weak_alias (scandirat, scandirat64) +#endif diff --git a/dirent/scandirat64.c b/dirent/scandirat64.c index a816ee9..608ca33 100644 --- a/dirent/scandirat64.c +++ b/dirent/scandirat64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2009, 2011 Free Software Foundation, Inc. +/* Copyright (C) 2000-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 @@ -17,9 +17,14 @@ #include +/* scandirat.c defines scandirat64 as an alias if _DIRENT_MATCHES_DIRENT64. */ +#ifndef _DIRENT_MATCHES_DIRENT64 + #define SCANDIRAT scandirat64 #define READDIR __readdir64 #define DIRENT_TYPE struct dirent64 #define SKIP_SCANDIR_CANCEL 1 #include "scandirat.c" + +#endif diff --git a/dirent/versionsort.c b/dirent/versionsort.c index 47bda04..ee34659 100644 --- a/dirent/versionsort.c +++ b/dirent/versionsort.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1997, 1998, 2009 Free Software Foundation, Inc. +/* Copyright (C) 1992-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 @@ -15,7 +15,15 @@ License along with the GNU C Library; if not, see . */ +/* We need to avoid the header declaration of versionsort64, because + the types don't match versionsort and then the compiler will + complain about the mismatch when we do the alias below. */ +#define versionsort64 __renamed_versionsort64 + #include + +#undef versionsort64 + #include int @@ -23,3 +31,7 @@ versionsort (const struct dirent **a, const struct dirent **b) { return __strverscmp ((*a)->d_name, (*b)->d_name); } + +#ifdef _DIRENT_MATCHES_DIRENT64 +weak_alias (versionsort, versionsort64) +#endif diff --git a/dirent/versionsort64.c b/dirent/versionsort64.c index 5b40e10..dca72e8 100644 --- a/dirent/versionsort64.c +++ b/dirent/versionsort64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1997, 1998, 2000, 2009 Free Software Foundation, Inc. +/* Copyright (C) 1992-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 @@ -18,8 +18,13 @@ #include #include +/* versionsort.c defines a versionsort64 alias if _DIRENT_MATCHES_DIRENT64. */ +#ifndef _DIRENT_MATCHES_DIRENT64 + int versionsort64 (const struct dirent64 **a, const struct dirent64 **b) { return __strverscmp ((*a)->d_name, (*b)->d_name); } + +#endif -- cgit v1.1