winpthreads: remove winpthread_internal.h

This header file declares two internal functions:

- __pth_gpointer_locked, which is also declared in thread.h
- pthread_delay_np_ms, which is defined in thread.c

Declaration of `pthread_delay_np_ms` has been moved to thread.h so that
it is declared in header file associtated with source file it is
defined in.

`pthread_delay_np_ms` has been renamed to `_pthread_delay_np_ms`
to make it explicit that this function is internal.

Signed-off-by: Kirill Makurin <maiddaisuki@outlook.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
diff --git a/mingw-w64-libraries/winpthreads/Makefile.am b/mingw-w64-libraries/winpthreads/Makefile.am
index cf78f4c..8fbdda9 100644
--- a/mingw-w64-libraries/winpthreads/Makefile.am
+++ b/mingw-w64-libraries/winpthreads/Makefile.am
@@ -28,7 +28,6 @@
   src/spinlock.c                \
   src/sched.c                   \
   src/thread.c    src/thread.h  \
-  src/winpthread_internal.h     \
   src/wpth_ver.h                \
   src/version.rc
 
diff --git a/mingw-w64-libraries/winpthreads/src/cond.c b/mingw-w64-libraries/winpthreads/src/cond.c
index cad966e..b0ff65b 100644
--- a/mingw-w64-libraries/winpthreads/src/cond.c
+++ b/mingw-w64-libraries/winpthreads/src/cond.c
@@ -34,7 +34,6 @@
 #include "cond.h"
 #include "thread.h"
 #include "misc.h"
-#include "winpthread_internal.h"
 
 #include "pthread_compat.h"
 
@@ -135,7 +134,7 @@
     {
       dw = (DWORD) (delay >= 99999ULL ? 99999ULL : delay);
       tick = _pthread_time_in_ms ();
-      pthread_delay_np_ms (dw);
+      _pthread_delay_np_ms (dw);
       tick2 = _pthread_time_in_ms ();
       tick2 -= tick;
       if (tick2 >= delay)
diff --git a/mingw-w64-libraries/winpthreads/src/nanosleep.c b/mingw-w64-libraries/winpthreads/src/nanosleep.c
index 0cce449..5ee5ef6 100644
--- a/mingw-w64-libraries/winpthreads/src/nanosleep.c
+++ b/mingw-w64-libraries/winpthreads/src/nanosleep.c
@@ -9,7 +9,7 @@
 #include <windows.h>
 #include "pthread.h"
 #include "pthread_time.h"
-#include "winpthread_internal.h"
+#include "thread.h"
 
 #define POW10_3                 1000
 #define POW10_4                 10000
@@ -48,7 +48,7 @@
         else ms = (unsigned long) u64;
 
         u64 -= ms;
-        rc = pthread_delay_np_ms(ms);
+        rc = _pthread_delay_np_ms(ms);
     }
 
     if (rc != 0) { /* WAIT_IO_COMPLETION (192) */
diff --git a/mingw-w64-libraries/winpthreads/src/thread.c b/mingw-w64-libraries/winpthreads/src/thread.c
index 6e897f0..bee7670 100644
--- a/mingw-w64-libraries/winpthreads/src/thread.c
+++ b/mingw-w64-libraries/winpthreads/src/thread.c
@@ -29,7 +29,6 @@
 #include "pthread.h"
 #include "thread.h"
 #include "misc.h"
-#include "winpthread_internal.h"
 
 static _pthread_v *__pthread_self_lite (void);
 
@@ -671,10 +670,8 @@
   return 0;
 }
 
-int pthread_delay_np_ms (DWORD to);
-
 int
-pthread_delay_np_ms (DWORD to)
+_pthread_delay_np_ms (DWORD to)
 {
   struct _pthread_v *s = __pthread_self_lite ();
 
diff --git a/mingw-w64-libraries/winpthreads/src/thread.h b/mingw-w64-libraries/winpthreads/src/thread.h
index 97bfda7..c38ff2b 100644
--- a/mingw-w64-libraries/winpthreads/src/thread.h
+++ b/mingw-w64-libraries/winpthreads/src/thread.h
@@ -71,5 +71,6 @@
 void _pthread_setnobreak(int);
 int  __pthread_shallcancel(void);
 WINPTHREAD_API struct _pthread_v * __pth_gpointer_locked (pthread_t id);
+int _pthread_delay_np_ms (DWORD to);
 
 #endif
diff --git a/mingw-w64-libraries/winpthreads/src/winpthread_internal.h b/mingw-w64-libraries/winpthreads/src/winpthread_internal.h
deleted file mode 100644
index eb6838c..0000000
--- a/mingw-w64-libraries/winpthreads/src/winpthread_internal.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-   Copyright (c) 2011-2016  mingw-w64 project
-
-   Permission is hereby granted, free of charge, to any person obtaining a
-   copy of this software and associated documentation files (the "Software"),
-   to deal in the Software without restriction, including without limitation
-   the rights to use, copy, modify, merge, publish, distribute, sublicense,
-   and/or sell copies of the Software, and to permit persons to whom the
-   Software is furnished to do so, subject to the following conditions:
-
-   The above copyright notice and this permission notice shall be included in
-   all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-   DEALINGS IN THE SOFTWARE.
-*/
-
-#ifndef WINPTHREAD_INTERNAL_H
-#define WINPTHREAD_INTERNAL_H
-WINPTHREAD_API struct _pthread_v * __pth_gpointer_locked (pthread_t id);
-int pthread_delay_np_ms (DWORD to);
-#endif /*WINPTHREAD_INTERNAL_H*/