[PATCH] Cygwin: signal.cc: Include <unistd.h>

Sebastian Huber <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
Include <unistd.h> for sleep() and usleep() declarations.  Fix return type of
usleep().
---
 winsup/cygwin/signal.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc
index 9b6c2509d..22d3715df 100644
--- a/winsup/cygwin/signal.cc
+++ b/winsup/cygwin/signal.cc
@@ -11,6 +11,7 @@ details. */
 
 #include "winsup.h"
 #include <stdlib.h>
+#include <unistd.h>
 #include <sys/cygwin.h>
 #include <sys/signalfd.h>
 #include "pinfo.h"
@@ -163,7 +164,7 @@ nanosleep (const struct timespec *rqtp, struct timespec *rmtp)
   return 0;
 }
 
-extern "C" unsigned int
+unsigned int
 sleep (unsigned int seconds)
 {
   struct timespec req, rem;
@@ -174,7 +175,7 @@ sleep (unsigned int seconds)
   return 0;
 }
 
-extern "C" unsigned int
+int
 usleep (useconds_t useconds)
 {
   struct timespec req;
-- 
2.35.3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.