about summary refs log tree commit diff
path: root/libio/bits/stdio.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-01-08 08:50:37 +0000
committerUlrich Drepper <drepper@redhat.com>2001-01-08 08:50:37 +0000
commit9b2c75233e67af1943af87a4fd39c6b316064b1f (patch)
tree5cf54675b0067d9be0ee80e5f2d3e8fb2f3a180c /libio/bits/stdio.h
parentbf2c10ded6bd31d7b923408f099b32b549acb934 (diff)
downloadglibc-9b2c75233e67af1943af87a4fd39c6b316064b1f.tar.gz
glibc-9b2c75233e67af1943af87a4fd39c6b316064b1f.tar.xz
glibc-9b2c75233e67af1943af87a4fd39c6b316064b1f.zip
Update.
2001-01-08  Ulrich Drepper  <drepper@redhat.com>

	* libio/bits/stdio.h (printf): Define macro to map printf call to
	fprintf which gcc can optimize.
Diffstat (limited to 'libio/bits/stdio.h')
-rw-r--r--libio/bits/stdio.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/libio/bits/stdio.h b/libio/bits/stdio.h
index 2522a3846e..0b4f614221 100644
--- a/libio/bits/stdio.h
+++ b/libio/bits/stdio.h
@@ -1,5 +1,5 @@
 /* Optimizing macros and inline functions for stdio functions.
-   Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public License as
@@ -28,6 +28,13 @@
 
 
 #ifdef __USE_EXTERN_INLINES
+/* Since version 2.97 GCC knows about `fprintf' and can optimize certain
+   cases.  Help gcc to optimize more code by mapping `printf' to the known
+   `fprintf' function.  Unfortunately we have to use a macro.  */
+# if __GNUC_PREREQ (2,97)
+#  define printf(fmt, args...) fprintf (stdout, fmt, ##args)
+# endif
+
 /* Write formatted output to stdout from argument list ARG.  */
 __STDIO_INLINE int
 vprintf (__const char *__restrict __fmt, _G_va_list __arg) __THROW