mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2026-02-06 01:39:47 +08:00
fix(win): replace std::hex/std::dec with ipc::spec for MinGW compatibility (issue #171)
Replace I/O manipulators (std::hex, std::dec) with ipc::spec in log statements. The ipc::fmt system does not support std::iostream manipulators, which caused compilation failures under MinGW. Changed files: - src/libipc/platform/win/mutex.h (lines 78, 96) - src/libipc/platform/win/semaphore.h (line 71) The format spec "#x" produces output like "0x102" which matches the original behavior: - # flag adds the "0x" prefix automatically - x outputs lowercase hexadecimal Fixes: #171
This commit is contained in:
parent
9079ca83ce
commit
642be3629b
@ -75,7 +75,7 @@ public:
|
||||
}
|
||||
break; // loop again
|
||||
default:
|
||||
log.error("fail WaitForSingleObject[", ::GetLastError(), "]: 0x", std::hex, ret, std::dec);
|
||||
log.error("fail WaitForSingleObject[", ::GetLastError(), "]: ", ipc::spec("#x")(ret));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -93,7 +93,7 @@ public:
|
||||
unlock();
|
||||
LIBIPC_FALLTHROUGH;
|
||||
default:
|
||||
log.error("fail WaitForSingleObject[", ::GetLastError(), "]: 0x", std::hex, ret, std::dec);
|
||||
log.error("fail WaitForSingleObject[", ::GetLastError(), "]: ", ipc::spec("#x")(ret));
|
||||
throw std::system_error{static_cast<int>(ret), std::system_category()};
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ public:
|
||||
return false;
|
||||
case WAIT_ABANDONED:
|
||||
default:
|
||||
log.error("fail WaitForSingleObject[", ::GetLastError(), "]: 0x", std::hex, ret, std::dec);
|
||||
log.error("fail WaitForSingleObject[", ::GetLastError(), "]: ", ipc::spec("#x")(ret));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user