Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Unicode Character Set to build aws-cpp-sdk-core library #153

Closed
dkislov opened this issue Apr 8, 2016 · 5 comments
Closed

Use Unicode Character Set to build aws-cpp-sdk-core library #153

dkislov opened this issue Apr 8, 2016 · 5 comments
Labels
bug This issue is a bug.

Comments

@dkislov
Copy link

dkislov commented Apr 8, 2016

When I set in Visual Studio 2013 Use Unicode Character Set for aws-cpp-sdk-core project property I got cast error: C2664: 'BOOL GetVersionExA(LPOSVERSIONINFOA)' : cannot convert argument 1 from 'OSVERSIONINFO *' to 'LPOSVERSIONINFOA' D:\xxxxx\aws-sdk-cpp\aws-cpp-sdk-core\source\utils\OSVersionInfo.cpp. My solution to solve this error is :
change line GetVersionExA(&versionInfo); to:

ifdef _UNICODE

GetVersionExA(reinterpret_cast<LPOSVERSIONINFOA>(&versionInfo));

else

GetVersionExA(&versionInfo);

endif

Am I right?

@Bu11etmagnet
Copy link

No.
GetVersionExA is always "ANSI". versioninfo should be always-ANSI too. (OSVERSIONINFOA ?)

@JonathanHenson
Copy link
Contributor

We support Unicode the Unix way, and don't want the complexity or mess that comes with window's half baked unicode solution. You can use unicode safely in the SDK by just passing unicode strings as char* or std::string. Unfortunately, this may mean you need to convert wchar* or std::wstring over, but this is less problematic than trying to support wchar formats in general.

I see we have a bug here with the version info struct we are using will update. I'll update this issue once we update it.

@JonathanHenson
Copy link
Contributor

Confirmed, we are using OSVersionInfo instead of OSVersionInfoA, this causes people compiling with unicode turned on with TCHAR resolving to WCHAR to have broken builds.

https://msdn.microsoft.com/en-us/library/windows/desktop/ms724834(v=vs.85).aspx

Will update when bug is fixed.

@JonathanHenson JonathanHenson added the bug This issue is a bug. label Apr 11, 2016
@JonathanHenson
Copy link
Contributor

I've got an update going through CI right now. I'll push out as soon as it's finished.

JonathanHenson added a commit that referenced this issue Apr 12, 2016
@JonathanHenson
Copy link
Contributor

I pushed the update out, can you verify your build?

cobookman pushed a commit to cobookman/aws-sdk-cpp that referenced this issue Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants