[FFmpeg-cvslog] log: include unistd.h only when needed
Mans Rullgard
git at videolan.org
Fri Jun 22 22:36:33 CEST 2012
ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Thu Jun 21 16:33:36 2012 +0100| [539df61193f2452ddeb74999f0ae301d7a7318cc] | committer: Mans Rullgard
log: include unistd.h only when needed
The only symbol this file uses from unistd.h is isatty(). By
including the header only when this function is used, the file
can be built on systems without unistd.h (which presumably also
lack isatty).
Signed-off-by: Mans Rullgard <mans at mansr.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=539df61193f2452ddeb74999f0ae301d7a7318cc
---
libavutil/log.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavutil/log.c b/libavutil/log.c
index 5e84129..e4a9fec 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -24,7 +24,11 @@
* logging functions
*/
+#include "config.h"
+
+#if HAVE_ISATTY
#include <unistd.h>
+#endif
#include <stdlib.h>
#include "avstring.h"
#include "avutil.h"
More information about the ffmpeg-cvslog
mailing list