From 836808a6e7bdc40379002189c5141fab6d3ad078 Mon Sep 17 00:00:00 2001 From: verhaegs Date: Sat, 7 Apr 2012 20:17:01 +0000 Subject: [PATCH] compiler/clib: Use .alias for getc() and putc() Only code for fputc() and fgetc() remains. This patch break binary compatibility. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@44556 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- compiler/clib/arosc.conf | 8 ++++---- compiler/clib/getc.c | 22 +++++----------------- compiler/clib/getchar.c | 2 +- compiler/clib/putc.c | 23 ++++++----------------- 4 files changed, 16 insertions(+), 39 deletions(-) diff --git a/compiler/clib/arosc.conf b/compiler/clib/arosc.conf index b6cd55995a..992bf992e6 100644 --- a/compiler/clib/arosc.conf +++ b/compiler/clib/arosc.conf @@ -46,10 +46,12 @@ int vprintf(const char * restrict format, va_list arg) int fprintf(FILE * restrict stream, const char * restrict format, ...) int vfprintf(FILE * restrict stream, const char * restrict format, va_list arg) int fputc(int c, FILE *stream) +.alias putc int fputs(const char * restrict s, FILE * restrict stream) int puts(const char *s) int fflush(FILE *stream) int fgetc(FILE *stream) +.alias getc int ungetc(int c, FILE *stream) char *fgets(char * restrict s, int n, FILE * restrict stream) int feof(FILE *stream) @@ -277,10 +279,8 @@ int regcomp(regex_t * __restrict, const char * __restrict, int) size_t regerror(int, const regex_t * __restrict, char * __restrict, size_t) int regexec(const regex_t * __restrict, const char * __restrict, size_t, regmatch_t * __restrict, int) void regfree(regex_t *) -int putc(int, FILE *) -#.function fputc -int getc(FILE *) -#.function fgetc + + int getchar(void) char *gets(char *s) diff --git a/compiler/clib/getc.c b/compiler/clib/getc.c index cd70f8c35f..f7b37cc831 100644 --- a/compiler/clib/getc.c +++ b/compiler/clib/getc.c @@ -2,29 +2,20 @@ Copyright © 1995-2012, The AROS Development Team. All rights reserved. $Id$ - ANSI C function getc(). + C99 function getc(). */ -#include -#include -#include -#include -#include "__fdesc.h" - -#define _STDIO_H_NOMACRO -#include - /***************************************************************************** - NAME */ + NAME #include int getc ( -/* SYNOPSIS */ + SYNOPSIS FILE * stream) -/* FUNCTION + FUNCTION Read one character from the stream. If there is no character available or an error occurred, the function returns EOF. @@ -44,9 +35,6 @@ fgetc(), fputc(), putc() INTERNALS + getc() is just an alias for fgetc(). ******************************************************************************/ -{ - return fgetc(stream); -} /* getc */ - diff --git a/compiler/clib/getchar.c b/compiler/clib/getchar.c index 4553dedf40..d135963c98 100644 --- a/compiler/clib/getchar.c +++ b/compiler/clib/getchar.c @@ -46,6 +46,6 @@ ******************************************************************************/ { - return getc(stdin); + return fgetc(stdin); } /* getc */ diff --git a/compiler/clib/putc.c b/compiler/clib/putc.c index 1f021587f0..394acb9ae1 100644 --- a/compiler/clib/putc.c +++ b/compiler/clib/putc.c @@ -2,30 +2,21 @@ Copyright © 1995-2012, The AROS Development Team. All rights reserved. $Id$ - ANSI C function putc(). + C99 function putc(). */ -#include -#include -#include -#include -#include "__fdesc.h" - -#define _STDIO_H_NOMACRO -#include - /***************************************************************************** - NAME */ + NAME #include int putc ( -/* SYNOPSIS */ + SYNOPSIS int c, FILE * stream) -/* FUNCTION + FUNCTION Write one character to the specified stream. INPUTS @@ -42,11 +33,9 @@ BUGS SEE ALSO + fputc() INTERNALS + putc() is just an alias for fputc() ******************************************************************************/ -{ - return fputc(c, stream); -} /* putc */ - -- 2.11.4.GIT