aboutsummaryrefslogtreecommitdiff
path: root/gcc/system.h
diff options
context:
space:
mode:
authorZack Weinberg <zack@rabi.phys.columbia.edu>1999-03-19 00:47:41 +0000
committerJeff Law <law@gcc.gnu.org>1999-03-18 17:47:41 -0700
commit9c30c0e76a04d193c7ffa850c2357931b728d87a (patch)
tree3f666fa4225b96bda8e31b545e0a8ca45460b3d9 /gcc/system.h
parent21677228916e96eff78fb5ad3b84f147daec690c (diff)
downloadgcc-9c30c0e76a04d193c7ffa850c2357931b728d87a.zip
gcc-9c30c0e76a04d193c7ffa850c2357931b728d87a.tar.gz
gcc-9c30c0e76a04d193c7ffa850c2357931b728d87a.tar.bz2
system.h: Use putc_unlocked...
* system.h: Use putc_unlocked, fputc_unlocked, and fputs_unlocked only if putc_unlocked has a prototype already. Prototype fputs_unlocked if necessary. * configure.in: Check for prototypes of putc_unlocked and fputs_unlocked. * acconfig.h: Updated. * config.in, configure: Rebuilt. From-SVN: r25855
Diffstat (limited to 'gcc/system.h')
-rw-r--r--gcc/system.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/system.h b/gcc/system.h
index e668a9e..a744760 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -37,18 +37,28 @@ Boston, MA 02111-1307, USA. */
#endif
/* The compiler is not a multi-threaded application and therefore we
- do not have to use the locking functions. */
-#ifdef HAVE_PUTC_UNLOCKED
+ do not have to use the locking functions.
+
+ NEED_DECLARATION_PUTC_UNLOCKED actually indicates whether or not
+ the IO code is multi-thread safe by default. If it is not declared,
+ then do not worry about using the _unlocked functions.
+
+ fputs_unlocked is an extension and needs to be prototyped specially. */
+
+#if defined HAVE_PUTC_UNLOCKED && !defined NEED_DECLARATION_PUTC_UNLOCKED
# undef putc
# define putc(C, Stream) putc_unlocked (C, Stream)
#endif
-#ifdef HAVE_FPUTC_UNLOCKED
+#if defined HAVE_FPUTC_UNLOCKED && !defined NEED_DECLARATION_PUTC_UNLOCKED
# undef fputc
# define fputc(C, Stream) fputc_unlocked (C, Stream)
#endif
-#ifdef HAVE_FPUTS_UNLOCKED
+#if defined HAVE_FPUTS_UNLOCKED && !defined NEED_DECLARATION_PUTC_UNLOCKED
# undef fputs
# define fputs(String, Stream) fputs_unlocked (String, Stream)
+# ifdef NEED_DECLARATION_FPUTS_UNLOCKED
+extern int fputs_unlocked PROTO ((const char *, FILE *));
+# endif
#endif
#include <ctype.h>