diff --git a/src/include/port/win32.h b/src/include/port/win32.h
new file mode 100644
index 611e04f..829624c
*** a/src/include/port/win32.h
--- b/src/include/port/win32.h
***************
*** 59,61 ****
--- 59,70 ----
  #else
  #define PGDLLEXPORT
  #endif
+ 
+ /*
+  * define isatty() to be _isatty() on WIN32 platforms
+  *  https://msdn.microsoft.com/en-us/library/ms235388.aspx
+  */
+ 
+ #ifdef WIN32
+ #define  isatty(fd)  _isatty(fd)
+ #endif
