Skip to content

Commit a049ea3

Browse files
committed
Merge pull request #7 from steve-m-hay/master
Fix build in C++ mode
2 parents b5174a8 + 73fffd9 commit a049ea3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Win32.xs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ get_unicode_env(pTHX_ WCHAR *name)
237237
pfnCreateEnvironmentBlock(&env, token, FALSE))
238238
{
239239
size_t name_len = wcslen(name);
240-
WCHAR *entry = env;
240+
WCHAR *entry = (WCHAR *)env;
241241
while (*entry) {
242242
size_t i;
243243
size_t entry_len = wcslen(entry);
@@ -818,7 +818,11 @@ XS(w32_GuidGen)
818818

819819
if (SUCCEEDED(hr)) {
820820
LPOLESTR pStr = NULL;
821+
#ifdef __cplusplus
822+
if (SUCCEEDED(StringFromCLSID(guid, &pStr))) {
823+
#else
821824
if (SUCCEEDED(StringFromCLSID(&guid, &pStr))) {
825+
#endif
822826
WideCharToMultiByte(CP_ACP, 0, pStr, (int)wcslen(pStr), szGUID,
823827
sizeof(szGUID), NULL, NULL);
824828
CoTaskMemFree(pStr);

0 commit comments

Comments
 (0)