The-Forge icon indicating copy to clipboard operation
The-Forge copied to clipboard

(Windows 7) WindowsThread.c - SetThreadDescription()

Open haloman30 opened this issue 2 years ago • 7 comments

Hello! I've been looking around to toy with several graphics libraries for a game engine I'm in the process of building, and I ran into a minor hiccup with this one.

I'm not sure if you guys still support Windows 7 at all, but I just did a fresh clone and build attempt and I ran into a bit of an issue - When compiling OS, it fails in WindowsThread.c at a function called SetThreadDescription. After some research, it seems that this function doesn't exist at all under Windows 7 (or 8 for that matter) as detailed here.

Commenting out these two lines results in compilation (seemingly) without issue, though I have to imagine that randomly commenting out lines won't be ideal long-term.

Common_3\OS\Windows\WindowsThread.c:

/*137*/                HRESULT res = SetThreadDescription(GetCurrentThread(), windowsThreadName);
/*138*/                ASSERT(!FAILED(res));

The error log is as follows:

1>I:\Development\Github\ConfettiFX\The-Forge\Common_3\OS\Windows\WindowsThread.c(137,37): error C2220: the following warning is treated as an error
1>I:\Development\Github\ConfettiFX\The-Forge\Common_3\OS\Windows\WindowsThread.c(137,37): warning C4013: 'SetThreadDescription' undefined; assuming extern returning int

Would be really cool to see this fixed - as outside of commenting out D3D12 rendering support, this was the only roadblock to getting it to compile and run under Win7.

haloman30 avatar May 17 '22 15:05 haloman30

What kind of Windows 7 setup do you have? Which Windows SDK are you using? I realize I forgot to put that info on the GitHub page. We probably need a define around this for specific Windows SDK version because when we tested this it worked :-)

wolfgangfengel avatar May 19 '22 17:05 wolfgangfengel

Was using the 8.1 SDK as its a lot easier to obtain than the Win7 SDK

haloman30 avatar May 19 '22 21:05 haloman30

I believe we used the same one ... I double-check and get back to you.

wolfgangfengel avatar May 20 '22 02:05 wolfgangfengel

Ok. Turns out we are using the windows 10 SDK in "windows 7 mode" for testing. Let me know if this is a problem.

wolfgangfengel avatar May 20 '22 02:05 wolfgangfengel

If I have it targeted to 10.0 SDK, it compiles but then no longer runs: image

I'm not familiar with this "Windows 7 Mode" feature of the SDK, so I'm not sure if theres some additional step I need to perform.

haloman30 avatar May 20 '22 02:05 haloman30

Ok. I make a note of this and we are going to look into it. I assume this will might end in two ways: either we describe how we installed windows 10 SDK and enabled "Windows 7 Mode" here on Github or we see if we can put a suitable define around this code with Windows 8.1 SDK. I don't know what the better way is at the moment. Thanks again for bringing this up!

wolfgangfengel avatar May 20 '22 02:05 wolfgangfengel

We will have a fix for this in the next release.

wolfgangfengel avatar May 20 '22 19:05 wolfgangfengel

Fixed with the latest release

manas-kulkarni avatar Feb 07 '24 07:02 manas-kulkarni