• Advertisement
Sign in to follow this  

Windows XP Compatibility

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement

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 this post


Link to post
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 this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement