Skip to content

Commit fa0e3ff

Browse files
authored
Hide windows.h in .cc file (#2952)
1 parent e9bd9b8 commit fa0e3ff

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

dlib/misc_api/misc_api_kernel_1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#include "misc_api_kernel_1.h"
1212

1313
#include "../windows_magic.h"
14-
#include <mmsystem.h>
1514
#include <windows.h>
15+
#include <mmsystem.h>
1616

1717
// tell visual studio to link to the library needed to call timeGetTime()
1818
#ifdef _MSC_VER

dlib/threads/threads_kernel_1.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,20 @@
99

1010
#include "threads_kernel_1.h"
1111

12+
#include "../windows_magic.h"
13+
#include <windows.h>
14+
1215
#include <process.h>
1316

1417

1518
namespace dlib
1619
{
20+
thread_id_type get_thread_id(
21+
)
22+
{
23+
return GetCurrentThreadId();
24+
}
25+
1726
namespace threads_kernel_shared_helpers
1827
{
1928

dlib/threads/threads_kernel_1.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
#include "threads_kernel_abstract.h"
1111

12-
#include "../windows_magic.h"
13-
#include <windows.h>
1412
#include "../algs.h"
1513
#include <condition_variable>
1614
#include <mutex>
@@ -22,13 +20,9 @@ namespace dlib
2220

2321
// ----------------------------------------------------------------------------------------
2422

25-
typedef DWORD thread_id_type;
23+
typedef unsigned long thread_id_type;
2624

27-
inline thread_id_type get_thread_id (
28-
)
29-
{
30-
return GetCurrentThreadId();
31-
}
25+
thread_id_type get_thread_id();
3226

3327
// ----------------------------------------------------------------------------------------
3428
// ----------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)