diff options
author | olli <olli@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-05-20 09:25:51 +0000 |
---|---|---|
committer | olli <olli@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-05-20 09:25:51 +0000 |
commit | c057192fa4bf2dbbda4d3fa7c70b41d57644f335 (patch) | |
tree | 9a66fb0620b15d9b44cb59ce186e55c97318cbe0 /ACE/ace/OS_NS_stdio.h | |
parent | 52cdf992790aa812428ca9e74f735233a7b60ab8 (diff) | |
download | ATCD-c057192fa4bf2dbbda4d3fa7c70b41d57644f335.tar.gz |
ChangeLogTag: Sun May 20 09:16:26 UTC 2007 Olli Savia <ops@iki.fi>
Diffstat (limited to 'ACE/ace/OS_NS_stdio.h')
-rw-r--r-- | ACE/ace/OS_NS_stdio.h | 77 |
1 files changed, 70 insertions, 7 deletions
diff --git a/ACE/ace/OS_NS_stdio.h b/ACE/ace/OS_NS_stdio.h index 18ca767ddab..69103ca2982 100644 --- a/ACE/ace/OS_NS_stdio.h +++ b/ACE/ace/OS_NS_stdio.h @@ -39,22 +39,70 @@ #endif #define ACE_EXPORT_MACRO ACE_Export -/** - * On some platforms clearerr is a macro. Defining ACE_OS::clearerr() - * becomes really hard, as there is no way to save the macro - * definition using the pre-processor. +/* + * We inline and undef some functions that may be implemented + * as macros on some platforms. This way macro definitions will + * be usable later as there is no way to save the macro definition + * using the pre-processor. + * */ # if !defined (ACE_LACKS_CLEARERR) # if defined (clearerr) -# define __ace_clearerr_hack -inline void __ace_clearerr(FILE *stream) +# define ACE_CLEARERR_MACRO_INLINED +inline void ace_clearerr_macro_inlined (FILE *stream) { - clearerr(stream); + clearerr (stream); } # undef clearerr # endif /* defined (clearerr) */ # endif /* !ACE_LACKS_CLEARERR */ +#if defined (fgetc) +# define ACE_FGETC_MACRO_INLINED +inline int ace_fgetc_macro_inlined (FILE *fp) +{ + return fgetc (fp); +} +# undef fgetc +#endif /* defined (fgetc) */ + +#if defined (fputc) +# define ACE_FPUTC_MACRO_INLINED +inline int ace_fputc_macro_inlined (int ch, FILE *fp) +{ + return fputc (ch, fp); +} +# undef fputc +#endif /* defined (fputc) */ + +#if defined (getc) +# define ACE_GETC_MACRO_INLINED +inline int ace_getc_macro_inlined (FILE *fp) +{ + return getc (fp); +} +# undef getc +#endif /* defined (getc) */ + +#if defined (putc) +# define ACE_PUTC_MACRO_INLINED +inline int ace_putc_macro_inlined (int ch, FILE *fp) +{ + return putc (ch, fp); +} +# undef putc +#endif /* defined (putc) */ + +#if defined (ungetc) +# define ACE_UNGETC_MACRO_INLINED +inline int ace_ungetc_macro_inlined (int ch, FILE *fp) +{ + return ungetc (ch, fp); +} +# undef ungetc +#endif /* defined (ungetc) */ + + #if !defined (ACE_LACKS_CUSERID) && !defined(ACE_HAS_ALT_CUSERID) \ && !defined(ACE_WIN32) && !defined (ACE_VXWORKS) /// Helper for the ACE_OS::cuserid() function @@ -171,6 +219,9 @@ namespace ACE_OS { int fgetc (FILE* fp); ACE_NAMESPACE_INLINE_FUNCTION + int getc (FILE* fp); + + ACE_NAMESPACE_INLINE_FUNCTION int fgetpos (FILE* fp, fpos_t* pos); ACE_NAMESPACE_INLINE_FUNCTION @@ -291,6 +342,18 @@ namespace ACE_OS { # endif /* ACE_HAS_WCHAR */ ACE_NAMESPACE_INLINE_FUNCTION + int ungetc (int c, + FILE *fp); + + ACE_NAMESPACE_INLINE_FUNCTION + int fputc (int c, + FILE *fp); + + ACE_NAMESPACE_INLINE_FUNCTION + int putc (int c, + FILE *fp); + + ACE_NAMESPACE_INLINE_FUNCTION int fputs (const char *s, FILE *stream); |