p3/regal — pull request #1 by malkia (2012-08-07 23:28:09+00:00)
Title: Support for Windows TLS API

Hi regal team,

The Windows XP with MSVCRT.DLL is my min-spec target, and I'm using the Windows WDK 7.1 to compile it.

Compiled this way, it runs fine under Vista / Windows 7, but it does not on XP. The problem is that __declspec(thread) is not supported there with the combination above.

Given that REGAL uses __declspec(thread) in isolated way, I've mimicked the pthread approach, and wrote a version, disabled by default, and enabled with #define REGAL_WIN_TLS 1 that uses the Widnows TLS API - TlsAlloc, TlsSet/GetValue, etc.

I've tested that under the one machine that I have with Windows XP Service Pack 3 (32-bit) and works so far.

Thanks,
Dimiter 'malkia' Stanev