Skip to content

Commit

Permalink
fix: use std::string to support node 22
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Mar 10, 2025
1 parent 6c9caa3 commit 64bfb1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/platform/win/report_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ string GetOsVersion() {
LPSERVER_INFO_101 os_info = NULL;
NET_API_STATUS nStatus = NetServerGetInfo(NULL, level, (LPBYTE*)&os_info);
if (nStatus == NERR_Success) {
LPSTR os_name = "Windows";
std::string os_name = "Windows";
const DWORD major = os_info->sv101_version_major & MAJOR_VERSION_MASK;
const DWORD type = os_info->sv101_type;
const bool isServer = (type & SV_TYPE_DOMAIN_CTRL) ||
Expand Down Expand Up @@ -165,7 +165,7 @@ string GetOsVersion() {
default:
os_name = (isServer ? "Windows Server" : "Windows Client");
}
data << os_name;
data << os_name.c_str();

// Convert and print the machine name and comment fields (these are LPWSTR
// types)
Expand Down Expand Up @@ -201,4 +201,4 @@ string GetOsVersion() {

} // namespace xprofiler

#endif
#endif

0 comments on commit 64bfb1d

Please sign in to comment.