Fix issues introduced with porting to macOS and sync with Windows
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
83d7fd844d
commit
bd14f7c629
@ -128,6 +128,7 @@
|
|||||||
<ClCompile Include="unicode.cpp" />
|
<ClCompile Include="unicode.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ClInclude Include="compat.hpp" />
|
||||||
<ClInclude Include="pch.h" />
|
<ClInclude Include="pch.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
@ -41,5 +41,8 @@
|
|||||||
<ClInclude Include="pch.h">
|
<ClInclude Include="pch.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="compat.hpp">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
@ -112,7 +112,7 @@ namespace UnitTests
|
|||||||
sstring filename[count];
|
sstring filename[count];
|
||||||
stdex::stream::fpos_t start[count];
|
stdex::stream::fpos_t start[count];
|
||||||
for (uint32_t i = 0; i < count; ++i) {
|
for (uint32_t i = 0; i < count; ++i) {
|
||||||
filename[i] = filepath + sprintf(_T("stdex-stream-open_close%zu.tmp"), NULL, i);
|
filename[i] = filepath + sprintf(_T("stdex-stream-open_close%u.tmp"), NULL, i);
|
||||||
dat.open(filename[i].c_str(), mode_for_reading | mode_for_writing | share_none | mode_preserve_existing | mode_binary);
|
dat.open(filename[i].c_str(), mode_for_reading | mode_for_writing | share_none | mode_preserve_existing | mode_binary);
|
||||||
Assert::IsTrue(dat.ok());
|
Assert::IsTrue(dat.ok());
|
||||||
start[i] = dat.tell();
|
start[i] = dat.tell();
|
||||||
|
@ -101,8 +101,18 @@ namespace stdex
|
|||||||
inline int16_t byteswap(_In_ const int16_t value) { return byteswap(static_cast<uint16_t>(value)); }
|
inline int16_t byteswap(_In_ const int16_t value) { return byteswap(static_cast<uint16_t>(value)); }
|
||||||
inline int32_t byteswap(_In_ const int32_t value) { return byteswap(static_cast<uint32_t>(value)); }
|
inline int32_t byteswap(_In_ const int32_t value) { return byteswap(static_cast<uint32_t>(value)); }
|
||||||
inline int64_t byteswap(_In_ const int64_t value) { return byteswap(static_cast<uint64_t>(value)); }
|
inline int64_t byteswap(_In_ const int64_t value) { return byteswap(static_cast<uint64_t>(value)); }
|
||||||
inline float byteswap(_In_ const float value) { return byteswap(*reinterpret_cast<const uint32_t*>(&value)); }
|
|
||||||
inline double byteswap(_In_ const double value) { return byteswap(*reinterpret_cast<const uint64_t*>(&value)); }
|
inline float byteswap(_In_ const float value)
|
||||||
|
{
|
||||||
|
uint32_t r = byteswap(*reinterpret_cast<const uint32_t*>(&value));
|
||||||
|
return *reinterpret_cast<float*>(&r);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline double byteswap(_In_ const double value)
|
||||||
|
{
|
||||||
|
uint64_t r = byteswap(*reinterpret_cast<const uint64_t*>(&value));
|
||||||
|
return *reinterpret_cast<double*>(&r);
|
||||||
|
}
|
||||||
|
|
||||||
inline void byteswap(_Inout_ uint8_t* value) { assert(value); *value = byteswap(*value); }
|
inline void byteswap(_Inout_ uint8_t* value) { assert(value); *value = byteswap(*value); }
|
||||||
inline void byteswap(_Inout_ uint16_t* value) { assert(value); *value = byteswap(*value); }
|
inline void byteswap(_Inout_ uint16_t* value) { assert(value); *value = byteswap(*value); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user