Advertisement

Windows XP Compatibility

Started by February 19, 2014 04:18 PM
4 comments, last by Jason Goepel 10 years, 9 months ago

AngelScript will no longer run on Windows XP (using VS2013 and the v120 Windows XP platform toolset). The project builds fine, but when loading on Windows XP there is a link error attempting to find InitializeCriticalSectionEx in kernel32.dll (I think).

I found that in order to maintain compatibility with Windows XP I needed to define a special preprocessor macro indicating the WINXP target. I used "AS_WINXP" for this purpse. You will see it in the attached patch.

It shouldn't be necessary to have a special preprocessor macro. InitializeCriticalSectionEx() should only be used when compiling for Windows Store, any other Windows platform should be using the older InitializeCriticalSection(). I'll review the preprocessor macro that is already used to see why it might not be working correctly for WinXP target.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement

I saw that was your intention, but I wasn't familiar enough with "WINAPI_FAMILY" and "WINAPI_PARTITION_DESKTOP" to deal with them.

In my headers, however, I saw:


#define WINAPI_FAMILY_PC_APP      2     /* Windows Store Applications */
#define WINAPI_FAMILY_PHONE_APP   3     /* Windows Phone Applications */
#define WINAPI_FAMILY_DESKTOP_APP 100   /* Windows Desktop Applications */

#define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP

#define WINAPI_PARTITION_DESKTOP   (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)


So, it looks like your guard becomes


#if defined(_MSC_VER) && !(100 & 1)

I have attached what my compiler produces when preprocessed to a file.

It's pretty much the same with CreateSemaphoreEx:

http://www.warsow.net/forum/thread/t/223185#post-223185

Please try revision 1847.

It should work on WinXP now.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Confirmed. It now runs on WinXP.

This topic is closed to new replies.

Advertisement