Skip to content

Commit

Permalink
Hide windows.h in .cc file (davisking#2952)
Browse files Browse the repository at this point in the history
  • Loading branch information
davisking authored Apr 27, 2024
1 parent e9bd9b8 commit fa0e3ff
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dlib/misc_api/misc_api_kernel_1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include "misc_api_kernel_1.h"

#include "../windows_magic.h"
#include <mmsystem.h>
#include <windows.h>
#include <mmsystem.h>

// tell visual studio to link to the library needed to call timeGetTime()
#ifdef _MSC_VER
Expand Down
9 changes: 9 additions & 0 deletions dlib/threads/threads_kernel_1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,20 @@

#include "threads_kernel_1.h"

#include "../windows_magic.h"
#include <windows.h>

#include <process.h>


namespace dlib
{
thread_id_type get_thread_id(
)
{
return GetCurrentThreadId();
}

namespace threads_kernel_shared_helpers
{

Expand Down
10 changes: 2 additions & 8 deletions dlib/threads/threads_kernel_1.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

#include "threads_kernel_abstract.h"

#include "../windows_magic.h"
#include <windows.h>
#include "../algs.h"
#include <condition_variable>
#include <mutex>
Expand All @@ -22,13 +20,9 @@ namespace dlib

// ----------------------------------------------------------------------------------------

typedef DWORD thread_id_type;
typedef unsigned long thread_id_type;

inline thread_id_type get_thread_id (
)
{
return GetCurrentThreadId();
}
thread_id_type get_thread_id();

// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
Expand Down

0 comments on commit fa0e3ff

Please sign in to comment.