log: include unistd.h only when needed
authorMans Rullgard <mans@mansr.com>
Thu, 21 Jun 2012 15:33:36 +0000 (16:33 +0100)
committerMans Rullgard <mans@mansr.com>
Thu, 21 Jun 2012 21:53:35 +0000 (22:53 +0100)
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@mansr.com>
libavutil/log.c

index 5e84129..e4a9fec 100644 (file)
  * logging functions
  */
 
+#include "config.h"
+
+#if HAVE_ISATTY
 #include <unistd.h>
+#endif
 #include <stdlib.h>
 #include "avstring.h"
 #include "avutil.h"