1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Fix some MSVC-specific warnings and add debug path as an MSVC directory

This commit is contained in:
kwolekr 2015-02-02 02:01:13 -05:00
parent 43f102271d
commit 0118c111e8
3 changed files with 12 additions and 10 deletions

14
src/jthread/win32/jsemaphore.cpp Executable file → Normal file
View file

@ -81,9 +81,9 @@ typedef struct _SEMAPHORE_BASIC_INFORMATION {
/* Note: this will only work as long as jthread is directly linked to application */
/* it's gonna fail if someone tries to build jthread as dll */
static _NtQuerySemaphore NtQuerySemaphore =
static _NtQuerySemaphore NtQuerySemaphore =
(_NtQuerySemaphore)
GetProcAddress
GetProcAddress
(GetModuleHandle ("ntdll.dll"), "NtQuerySemaphore");
int JSemaphore::GetValue() {
@ -91,16 +91,14 @@ int JSemaphore::GetValue() {
LONG retval;
assert(NtQuerySemaphore);
retval = NtQuerySemaphore (m_hSemaphore, 0,
&BasicInfo, sizeof (SEMAPHORE_BASIC_INFORMATION), NULL);
if (retval == ERROR_SUCCESS)
{
return BasicInfo.CurrentCount;
}
else {
assert("unable to read semaphore count" == 0);
}
assert("unable to read semaphore count" == 0);
return 0;
}