# Windows XP Compatibility

This topic is 2062 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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.

##### Share on other sites

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.

##### Share on other sites

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.

##### Share on other sites

It should work on WinXP now.

##### Share on other sites

Confirmed.  It now runs on WinXP.

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 18
• 33
• 9
• 16
• 22