summaryrefslogtreecommitdiffstats
path: root/Objects/fileobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/fileobject.c')
-rw-r--r--Objects/fileobject.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index 066172b..5522eba 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -4,15 +4,19 @@
#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_runtime.h" // _PyRuntime
+#ifdef HAVE_UNISTD_H
+# include <unistd.h> // isatty()
+#endif
+
#if defined(HAVE_GETC_UNLOCKED) && !defined(_Py_MEMORY_SANITIZER)
-/* clang MemorySanitizer doesn't yet understand getc_unlocked. */
-#define GETC(f) getc_unlocked(f)
-#define FLOCKFILE(f) flockfile(f)
-#define FUNLOCKFILE(f) funlockfile(f)
+ /* clang MemorySanitizer doesn't yet understand getc_unlocked. */
+# define GETC(f) getc_unlocked(f)
+# define FLOCKFILE(f) flockfile(f)
+# define FUNLOCKFILE(f) funlockfile(f)
#else
-#define GETC(f) getc(f)
-#define FLOCKFILE(f)
-#define FUNLOCKFILE(f)
+# define GETC(f) getc(f)
+# define FLOCKFILE(f)
+# define FUNLOCKFILE(f)
#endif
/* Newline flags */