Add PollType, so that we can support WSApoll on Windows.
authorbruceperens <bruceperens@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 18 Mar 2014 18:34:47 +0000 (18:34 +0000)
committerbruceperens <bruceperens@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 18 Mar 2014 18:34:47 +0000 (18:34 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@1449 01035d8c-6547-0410-b346-abe4f91aad63

freedv-server/source/audio_sink.cpp
freedv-server/source/blank_panel.cpp
freedv-server/source/drivers.h
freedv-server/source/platform/linux/audio_in_alsa.cpp
freedv-server/source/platform/linux/audio_out_alsa.cpp
freedv-server/source/ptt_constant.cpp
freedv-server/source/text_constant.cpp
freedv-server/source/tone.cpp

index 6d644dba61aaeda06966171b2046e219a0750839..42d0953cface9792aaf82e37ae1fd2b342f2640e 100644 (file)
@@ -17,7 +17,7 @@ namespace FreeDV {
         /// \return The address of an array of integers containing the
        /// file descriptors.
        virtual int
-               poll_fds(struct pollfd * array, int space);
+               poll_fds(PollType * array, int space);
 
        /// Return the number of audio samples the device can handle in
        /// a write without blocking. This version always returns SIZE_MAX.
@@ -46,7 +46,7 @@ namespace FreeDV {
   }
 
   int
-  AudioSink::poll_fds(struct pollfd *, int)
+  AudioSink::poll_fds(PollType *, int)
   {
     return 0;
   }
index 961756846937c71d24a070ab7d4c3e43939ccf97..5db66f4ebdcc13d4043589b4569909cacb8ab3a8 100644 (file)
@@ -16,7 +16,7 @@ namespace FreeDV {
     /// with the number of file descriptors in the array.
     /// \return The address of an array of integers containing the
     /// file descriptors.
-    virtual int        poll_fds(struct pollfd * array, int space);
+    virtual int        poll_fds(PollType * array, int space);
 
     /// Return the amount of bytes ready for read. In this case, it always
     /// returns 0.
@@ -33,7 +33,7 @@ namespace FreeDV {
   }
 
   int
-  BlankPanel::poll_fds(struct pollfd *, int)
+  BlankPanel::poll_fds(PollType *, int)
   {
     return 0;
   }
index 83e1028a97d07083475d4e342fe5b64e335053ab..091e8c9e2b5b5c098f3c21558df3c0a8b8202014 100644 (file)
@@ -223,8 +223,11 @@ public:
     /// written.
     virtual std::size_t        ready() = 0;
 
-    ///
-    virtual int                poll_fds(struct pollfd * array, int space) = 0;
+    /// Type used by poll_fds(). For portability to Windows.
+    typedef struct pollfd      PollType;
+
+    /// Poll file descriptors for available I/O.
+    virtual int                poll_fds(PollType * array, int space) = 0;
 
     virtual            ~IODevice() = 0;
 };
index e93b47c7f0d8e73d67fc372446533a1fee3d3723..f128289c1bb379a4f3461b8874f7a7963d617a37 100644 (file)
@@ -44,7 +44,7 @@ namespace FreeDV {
         /// \return The address of an array of integers containing the
        /// file descriptors.
        virtual int
-               poll_fds(struct pollfd * array, int space);
+               poll_fds(PollType * array, int space);
 
        /// Return the number of audio samples the device can provide in
        /// a read without blocking.
@@ -114,7 +114,7 @@ namespace FreeDV {
   }
 
   int
-  AudioInALSA::poll_fds(struct pollfd * array, int space)
+  AudioInALSA::poll_fds(PollType * array, int space)
   {
     const int size = snd_pcm_poll_descriptors_count(handle);
     
index cf371a41d371f995620c1b9724cf170574dfb046..ec5f353e611bc452b4d0835b84551d208088d61b 100644 (file)
@@ -42,7 +42,7 @@ namespace FreeDV {
         /// \return The address of an array of integers containing the
        /// file descriptors.
        virtual int
-               poll_fds(struct pollfd * array, int space);
+               poll_fds(PollType * array, int space);
 
        /// Return the number of audio samples the device can handle in
        /// a write without blocking.
@@ -111,7 +111,7 @@ namespace FreeDV {
   }
 
   int
-  AudioOutALSA::poll_fds(struct pollfd * array, int space)
+  AudioOutALSA::poll_fds(PollType * array, int space)
   {
     const int size = snd_pcm_poll_descriptors_count(handle);
     
index b673f03c8751d587d0b395d9e1c8f2d9e12a37d3..5755e71e18f48494412a6b84decbc5c7bd8cdcd7 100644 (file)
@@ -21,7 +21,7 @@ namespace FreeDV {
     /// with the number of file descriptors in the array.
     /// \return The address of an array of integers containing the
     /// file descriptors.
-    virtual int        poll_fds(struct pollfd * array, int space);
+    virtual int        poll_fds(PollType * array, int space);
 
     /// Return the amount of bytes ready for read.
     std::size_t        ready();
@@ -49,7 +49,7 @@ namespace FreeDV {
   }
 
   int
-  PTTConstant::poll_fds(struct pollfd *, int)
+  PTTConstant::poll_fds(PollType *, int)
   {
     return 0;
   }
index 57c9d888f5fb09b621dde68ea141b7e2c637d1ce..badbc3b2cc53075a8ca96dc37742bef84e5d35c8 100644 (file)
@@ -21,7 +21,7 @@ namespace FreeDV {
     /// with the number of file descriptors in the array.
     /// \return The address of an array of integers containing the
     /// file descriptors.
-    virtual int                poll_fds(struct pollfd * array, int space);
+    virtual int                poll_fds(PollType * array, int space);
 
     /// Read the text data.
     std::size_t                read(char * buffer, std::size_t size);
@@ -40,7 +40,7 @@ namespace FreeDV {
   }
 
   int
-  TextConstant::poll_fds(struct pollfd *, int)
+  TextConstant::poll_fds(PollType *, int)
   {
     return 0;
   }
index 97c61fac1fc6b6f629e229a5bda94157cb590a68..7598358db7051c76a3ee64488bf3b3f7933d1a1a 100644 (file)
@@ -24,7 +24,7 @@ namespace FreeDV {
     /// with the number of file descriptors in the array.
     /// \return The address of an array of integers containing the
     /// file descriptors.
-    virtual int        poll_fds(struct pollfd * array, int space);
+    virtual int        poll_fds(PollType * array, int space);
 
     /// Return the amount of audio samples for read. In this case, it always
     /// returns SIZE_MAX.
@@ -132,7 +132,7 @@ namespace FreeDV {
   }
 
   int
-  Tone::poll_fds(struct pollfd *, int)
+  Tone::poll_fds(PollType *, int)
   {
     return 0;
   }