From cc9c5de9013f824b4a301a8d676e3cfbe2bc04a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 21 Nov 2003 18:23:17 +0000 Subject: [PATCH] Small changes to let it compile. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5432 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../posix/glibc/stdio-common/asprintf.c | 6 ++++-- .../posix/glibc/stdio-common/getline.c | 15 ++++----------- .../libroot/posix/glibc/stdio-common/getw.c | 19 ++++++++----------- 3 files changed, 16 insertions(+), 24 deletions(-) diff --git a/src/kernel/libroot/posix/glibc/stdio-common/asprintf.c b/src/kernel/libroot/posix/glibc/stdio-common/asprintf.c index 3b211d62b8..0301095828 100644 --- a/src/kernel/libroot/posix/glibc/stdio-common/asprintf.c +++ b/src/kernel/libroot/posix/glibc/stdio-common/asprintf.c @@ -14,10 +14,12 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + 02111-1307 USA. +*/ + +#include #include -#include #ifdef USE_IN_LIBIO # include diff --git a/src/kernel/libroot/posix/glibc/stdio-common/getline.c b/src/kernel/libroot/posix/glibc/stdio-common/getline.c index 4acb41de77..7b9ff5993a 100644 --- a/src/kernel/libroot/posix/glibc/stdio-common/getline.c +++ b/src/kernel/libroot/posix/glibc/stdio-common/getline.c @@ -19,20 +19,13 @@ #include #include -#undef __getline -#ifdef USE_IN_LIBIO -# include "../libio/libioP.h" -# undef ssize_t -# define ssize_t _IO_ssize_t -# define __getdelim _IO_getdelim -#endif +/** Like getdelim, but always looks for a newline. */ -/* Like getdelim, but always looks for a newline. */ ssize_t -__getline (char **lineptr, size_t *n, FILE *stream) +__getline(char **lineptr, size_t *n, FILE *stream) { - return __getdelim (lineptr, n, '\n', stream); + return __getdelim(lineptr, n, '\n', stream); } -weak_alias (__getline, getline) +weak_alias(__getline, getline) diff --git a/src/kernel/libroot/posix/glibc/stdio-common/getw.c b/src/kernel/libroot/posix/glibc/stdio-common/getw.c index 81156e6781..675d33c705 100644 --- a/src/kernel/libroot/posix/glibc/stdio-common/getw.c +++ b/src/kernel/libroot/posix/glibc/stdio-common/getw.c @@ -18,19 +18,16 @@ #include -#ifdef USE_IN_LIBIO -# include -# define fread(p, m, n, s) INTUSE(_IO_fread) (p, m, n, s) -#endif -/* Read a word (int) from STREAM. */ +/** Read a word (int) from STREAM. */ + int -getw (FILE *stream) +getw(FILE *stream) { - int w; + int w; - /* Is there a better way? */ - if (fread ((void *) &w, sizeof (w), 1, stream) != 1) - return EOF; - return w; + if (fread((void *)&w, sizeof(w), 1, stream) != 1) + return EOF; + + return w; }