From 63a4c9adf227a6f6a5f7f70f6dc3f8863f846927 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 12 Sep 2018 00:28:34 -0400 Subject: remove spurious inclusion of libc.h for LFS64 ABI aliases the LFS64 macro was not self-documenting and barely saved any characters. simply use weak_alias directly so that it's clear what's being done, and doesn't depend on a header to provide a strange macro. --- src/stdio/fgetpos.c | 3 +-- src/stdio/fopen.c | 3 +-- src/stdio/freopen.c | 3 +-- src/stdio/fseek.c | 3 +-- src/stdio/fsetpos.c | 3 +-- src/stdio/ftell.c | 3 +-- src/stdio/tmpfile.c | 3 +-- 7 files changed, 7 insertions(+), 14 deletions(-) (limited to 'src/stdio') diff --git a/src/stdio/fgetpos.c b/src/stdio/fgetpos.c index 6b45f57f..50813d2c 100644 --- a/src/stdio/fgetpos.c +++ b/src/stdio/fgetpos.c @@ -1,5 +1,4 @@ #include "stdio_impl.h" -#include "libc.h" int fgetpos(FILE *restrict f, fpos_t *restrict pos) { @@ -9,4 +8,4 @@ int fgetpos(FILE *restrict f, fpos_t *restrict pos) return 0; } -LFS64(fgetpos); +weak_alias(fgetpos, fgetpos64); diff --git a/src/stdio/fopen.c b/src/stdio/fopen.c index 2a20c7f2..e1b91e12 100644 --- a/src/stdio/fopen.c +++ b/src/stdio/fopen.c @@ -2,7 +2,6 @@ #include #include #include -#include "libc.h" FILE *fopen(const char *restrict filename, const char *restrict mode) { @@ -31,4 +30,4 @@ FILE *fopen(const char *restrict filename, const char *restrict mode) return 0; } -LFS64(fopen); +weak_alias(fopen, fopen64); diff --git a/src/stdio/freopen.c b/src/stdio/freopen.c index 6d6d21d2..615d4b47 100644 --- a/src/stdio/freopen.c +++ b/src/stdio/freopen.c @@ -1,7 +1,6 @@ #include "stdio_impl.h" #include #include -#include "libc.h" /* The basic idea of this implementation is to open a new FILE, * hack the necessary parts of the new FILE into the old one, then @@ -51,4 +50,4 @@ fail: return NULL; } -LFS64(freopen); +weak_alias(freopen, freopen64); diff --git a/src/stdio/fseek.c b/src/stdio/fseek.c index 26d9f7ef..67d75f7a 100644 --- a/src/stdio/fseek.c +++ b/src/stdio/fseek.c @@ -1,5 +1,4 @@ #include "stdio_impl.h" -#include "libc.h" int __fseeko_unlocked(FILE *f, off_t off, int whence) { @@ -41,4 +40,4 @@ int fseek(FILE *f, long off, int whence) weak_alias(__fseeko, fseeko); -LFS64(fseeko); +weak_alias(fseeko, fseeko64); diff --git a/src/stdio/fsetpos.c b/src/stdio/fsetpos.c index cea5ddbb..77ab8d82 100644 --- a/src/stdio/fsetpos.c +++ b/src/stdio/fsetpos.c @@ -1,9 +1,8 @@ #include "stdio_impl.h" -#include "libc.h" int fsetpos(FILE *f, const fpos_t *pos) { return __fseeko(f, *(const long long *)pos, SEEK_SET); } -LFS64(fsetpos); +weak_alias(fsetpos, fsetpos64); diff --git a/src/stdio/ftell.c b/src/stdio/ftell.c index aad352bd..5ca41654 100644 --- a/src/stdio/ftell.c +++ b/src/stdio/ftell.c @@ -1,7 +1,6 @@ #include "stdio_impl.h" #include #include -#include "libc.h" off_t __ftello_unlocked(FILE *f) { @@ -35,4 +34,4 @@ long ftell(FILE *f) weak_alias(__ftello, ftello); -LFS64(ftello); +weak_alias(ftello, ftello64); diff --git a/src/stdio/tmpfile.c b/src/stdio/tmpfile.c index 7013f645..ae493987 100644 --- a/src/stdio/tmpfile.c +++ b/src/stdio/tmpfile.c @@ -2,7 +2,6 @@ #include #include #include "stdio_impl.h" -#include "libc.h" #define MAXTRIES 100 @@ -29,4 +28,4 @@ FILE *tmpfile(void) return 0; } -LFS64(tmpfile); +weak_alias(tmpfile, tmpfile64); -- cgit v1.2.1