>From f76bac920b122d07361b73305a4d779ec4536ca0 Mon Sep 17 00:00:00 2001
From: KO Myung-Hun <komh@chollian.net>
Date: Fri, 14 Oct 2011 21:51:05 +0900
Subject: [PATCH 25/26] Include missing unistd.h and time.h for OS/2

---
 modules/access/file.c                              |    2 --
 modules/access_output/livehttp.c                   |    4 ++++
 modules/control/motion.c                           |    4 ++++
 modules/misc/audioscrobbler.c                      |    4 ++++
 modules/stream_out/langfromtelx.c                  |    4 ++++
 modules/stream_out/rtsp.c                          |    4 ++++
 .../video_filter/dynamicoverlay/dynamicoverlay.c   |    4 ++++
 src/config/file.c                                  |    3 +++
 src/input/es_out_timeshift.c                       |    3 +++
 src/input/item.c                                   |    4 ++++
 src/interface/interface.c                          |    4 ++++
 src/misc/block.c                                   |    5 +++++
 src/misc/objects.c                                 |    4 ++++
 src/text/filesystem.c                              |    4 ++++
 src/video_output/video_epg.c                       |    4 ++++
 15 files changed, 55 insertions(+), 2 deletions(-)

diff --git a/modules/access/file.c b/modules/access/file.c
index be9044d..92c0411 100644
--- a/modules/access/file.c
+++ b/modules/access/file.c
@@ -59,8 +59,6 @@
 #   include <ctype.h>
 #   include <shlwapi.h>
 #   include <vlc_charset.h>
-#elif defined( __OS2__ )
-#   include <ctype.h>
 #else
 #   include <unistd.h>
 #endif
diff --git a/modules/access_output/livehttp.c b/modules/access_output/livehttp.c
index 52a383d..fbf93fc 100644
--- a/modules/access_output/livehttp.c
+++ b/modules/access_output/livehttp.c
@@ -34,6 +34,10 @@
 #include <fcntl.h>
 #include <errno.h>
 
+#ifdef __OS2__
+# include <unistd.h>    // close(), write()
+#endif
+
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
diff --git a/modules/control/motion.c b/modules/control/motion.c
index 6b620f3..5b21e36 100644
--- a/modules/control/motion.c
+++ b/modules/control/motion.c
@@ -32,6 +32,10 @@
 
 #include <math.h>
 
+#ifdef __OS2__
+# include <unistd.h>  // access(), R_OK
+#endif
+
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_interface.h>
diff --git a/modules/misc/audioscrobbler.c b/modules/misc/audioscrobbler.c
index 1c31af4..ca6edea 100644
--- a/modules/misc/audioscrobbler.c
+++ b/modules/misc/audioscrobbler.c
@@ -47,6 +47,10 @@
 #include <vlc_network.h>
 #include <vlc_playlist.h>
 
+#ifdef __OS2__
+# include <time.h>  // time()
+#endif
+
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
diff --git a/modules/stream_out/langfromtelx.c b/modules/stream_out/langfromtelx.c
index f6129c0..ff74854 100644
--- a/modules/stream_out/langfromtelx.c
+++ b/modules/stream_out/langfromtelx.c
@@ -26,6 +26,10 @@
  *****************************************************************************/
 #include <ctype.h>
 
+#ifdef __OS2__
+# include <unistd.h>    // off_t
+#endif
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/modules/stream_out/rtsp.c b/modules/stream_out/rtsp.c
index b7fee37..2f85a81 100644
--- a/modules/stream_out/rtsp.c
+++ b/modules/stream_out/rtsp.c
@@ -44,6 +44,10 @@
 #include <errno.h>
 #include <stdlib.h>
 
+#ifdef __OS2__
+# include <time.h>  // time(), gmtime_r(), struct tm
+#endif
+
 #ifndef WIN32
 # include <locale.h>
 #endif
diff --git a/modules/video_filter/dynamicoverlay/dynamicoverlay.c b/modules/video_filter/dynamicoverlay/dynamicoverlay.c
index 52dba04..719ba5d 100644
--- a/modules/video_filter/dynamicoverlay/dynamicoverlay.c
+++ b/modules/video_filter/dynamicoverlay/dynamicoverlay.c
@@ -40,6 +40,10 @@
 #include <fcntl.h>
 #include <errno.h>
 
+#ifdef __OS2__
+# include <unistd.h>    // read(), close(), write()
+#endif
+
 #include "dynamicoverlay.h"
 
 /*****************************************************************************
diff --git a/src/config/file.c b/src/config/file.c
index 81b8f3a..1eaf166 100644
--- a/src/config/file.c
+++ b/src/config/file.c
@@ -35,6 +35,9 @@
 #elif defined(HAVE_USELOCALE)
 #include <locale.h>
 #endif
+#ifdef __OS2__
+# include <unistd.h>    // getpid(), close(), fsync()
+#endif
 
 #include <vlc_common.h>
 #include "../libvlc.h"
diff --git a/src/input/es_out_timeshift.c b/src/input/es_out_timeshift.c
index fc45bd9..63f6f3b 100644
--- a/src/input/es_out_timeshift.c
+++ b/src/input/es_out_timeshift.c
@@ -37,6 +37,9 @@
 #ifdef HAVE_SYS_STAT_H
 #   include <sys/stat.h>
 #endif
+#ifdef __OS2__
+# include <unistd.h>    // close()
+#endif
 
 #include <vlc_common.h>
 #include <vlc_fs.h>
diff --git a/src/input/item.c b/src/input/item.c
index 13a1202..1a6094a 100644
--- a/src/input/item.c
+++ b/src/input/item.c
@@ -26,6 +26,10 @@
 #endif
 #include <assert.h>
 
+#ifdef __OS2__
+# include <time.h>      // struct tm, localtime_r()
+#endif
+
 #include <vlc_common.h>
 #include <vlc_url.h>
 #include "vlc_playlist.h"
diff --git a/src/interface/interface.c b/src/interface/interface.c
index 17ca466..6bd6081 100644
--- a/src/interface/interface.c
+++ b/src/interface/interface.c
@@ -43,6 +43,10 @@
 #include <vlc_interface.h>
 #include "libvlc.h"
 
+#ifdef __OS2__
+# include <unistd.h>    // isatty()
+#endif
+
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
diff --git a/src/misc/block.c b/src/misc/block.c
index a37e7fd..e126097 100644
--- a/src/misc/block.c
+++ b/src/misc/block.c
@@ -32,6 +32,11 @@
 #include <sys/stat.h>
 #include <assert.h>
 #include <errno.h>
+
+#ifdef __OS2__
+# include <unistd.h>    // pread()
+#endif
+
 #include "vlc_block.h"
 
 /**
diff --git a/src/misc/objects.c b/src/misc/objects.c
index 1a16c34..5cbd622 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -37,6 +37,10 @@
 # include "config.h"
 #endif
 
+#ifdef __OS2__
+# include <unistd.h>    // close(), write()
+#endif
+
 #include <vlc_common.h>
 
 #include "../libvlc.h"
diff --git a/src/text/filesystem.c b/src/text/filesystem.c
index d71c099..844183a 100644
--- a/src/text/filesystem.c
+++ b/src/text/filesystem.c
@@ -39,6 +39,10 @@
 #include <sys/types.h>
 #include <fcntl.h>
 
+#ifdef __OS2__
+# include <unistd.h>    // close()
+#endif
+
 /**
  * Opens a FILE pointer.
  * @param filename file path, using UTF-8 encoding
diff --git a/src/video_output/video_epg.c b/src/video_output/video_epg.c
index 05116a4..ee6abcb 100644
--- a/src/video_output/video_epg.c
+++ b/src/video_output/video_epg.c
@@ -24,6 +24,10 @@
 # include "config.h"
 #endif
 
+#ifdef __OS2__
+# include <time.h>      // time(), localtime_r(), struct tm
+#endif
+
 #include <vlc_common.h>
 #include <vlc_vout.h>
 #include <vlc_vout_osd.h>
-- 
1.7.3.2

