[*] Linux build regressons

This commit is contained in:
Reece Wilson 2023-12-04 21:11:32 +00:00
parent e60e308087
commit e9651eead3
13 changed files with 46 additions and 24 deletions

View File

@ -545,6 +545,8 @@ namespace Aurora::Memory
template<typename T>
bool ReadTagged(T &out);
template<typename T>
T ReadTagged();
//
inline AuUInt calcDifferenceBetweenHeadsUnsigned(AuUInt8 *pHeadPointer, AuUInt8 *pSubtrahend)

View File

@ -216,7 +216,7 @@ namespace Aurora::Memory
return true;
}
auto newLength = AuMax(length, AuPageRoundUp(this->allocSize + (this->allocSize / 3), 64ull));
auto newLength = AuMax(length, AuPageRoundUp(this->allocSize + (this->allocSize / 3), AuUInt(64)));
if (auto pNext = ZRealloc(this->base, newLength))
{

View File

@ -164,7 +164,7 @@ namespace Aurora::Memory
}
else if constexpr (AuIsTuple_v<AuRemoveReference_t<T>>)
{
if (this->ReadTagged<AuUInt16> !=
if (this->ReadTagged<AuUInt16>() !=
AuTupleCountOf_v<AuRemoveReference_t<T>>)
{
this->flagReadError = true;
@ -471,4 +471,23 @@ namespace Aurora::Memory
return Read(out);
}
template<typename T>
T ByteBuffer::ReadTagged()
{
T value {};
if (__detail::TypeToID<T>() != Read<AuUInt8>())
{
this->flagReadError = true;
return value;
}
if (!Read(value))
{
return false;
}
return true;
}
}

View File

@ -122,7 +122,7 @@ namespace Aurora::Async
AuThreads::TLSVariable<WorkerWPId_t> tlsWorkerId;
AuSPtr<ThreadState> GetThreadHandle(WorkerId_t id);
AuSPtr<ThreadState> GetThreadHandle(WorkerId_t id) override;
private:
// TODO: BarrierMultiple
bool Barrier(WorkerId_t, AuUInt32 ms, bool requireSignal, bool drop);

View File

@ -52,7 +52,7 @@ namespace Aurora::Async
EWorkPrio GetPrio() override;
void SetPrio(EWorkPrio prio) override;
AuOptional<AuPair<AuUInt32, AuUInt32>> QueryFences();
AuOptional<AuPair<AuUInt32, AuUInt32>> QueryFences() override;
protected:
bool CheckAlive();

View File

@ -149,7 +149,7 @@ namespace Aurora::IO::IPC
IPCPipeImpl::IPCPipeImpl(int (fds2)[2], int (fds3)[2], IPCToken readEnd, IPCToken writeEnd, AuSPtr<IPCEvent> event, AuSPtr<IPCMutex> mutex) :
fds {fds2[0], fds2[1]}, secondary {fds3[0], fds3[1]},
readEnd_(readEnd), writeEnd_(writeEnd), event_(event), mutex_(mutex),
eventPreempt_(false, false, true,
eventPreempt_(false, false, true),
pipeReader_(this),
pipeWriter_(this)
{

View File

@ -400,8 +400,7 @@ namespace Aurora::IO::Net
strncpy(ifr.ifr_name, adapter.device.c_str(), sizeof(ifr.ifr_name));
ifr.ifr_data = &edata;
edata.cmd = ETHTOOL_GSET;
auto iRet = ::ioctl(sock, SIOCETHTOOL, &ifr);
if (iRet < 0)
if (::ioctl(iSocket, SIOCETHTOOL, &ifr) < 0)
{
::close(iSocket);
return;
@ -501,7 +500,6 @@ namespace Aurora::IO::Net
case ARPHRD_IEEE80211_RADIOTAP:
case ARPHRD_IEEE802154:
case ARPHRD_IEEE802154_MONITOR:
define
adapter.eNetworkType = ENetworkAdapterType::eIEEE80211;
break;
case ARPHRD_PRONET:
@ -523,8 +521,8 @@ namespace Aurora::IO::Net
auto attr = IFLA_RTA(ifa);
auto attrlen = hdr->nlmsg_len - NLMSG_LENGTH(sizeof(*ifa));
for (; RTA_OK(attr, attrlen); attr = RTA_NEXT(attr, attrlen)) {
for (; RTA_OK(attr, attrlen); attr = RTA_NEXT(attr, attrlen))
{
size_t dstlen = RTA_PAYLOAD(attr);
if (attr->rta_type == IFLA_IFNAME)
@ -555,8 +553,8 @@ namespace Aurora::IO::Net
adapter.uTransmitBytesPerSec = pStats64->tx_bytes;
adapter.uReceiveBytesPerSec = pStats64->rx_bytes;
}
}
#endif
}
}
}
}

View File

@ -29,8 +29,9 @@ namespace Aurora::IO::Net
struct NetWorker *pWorker,
const AuSPtr<ISocketDriver> &pSocketDriver,
AuUInt osHandle,
AuSPtr<ISocketServer> pParent) :
SocketBase(pInterface, pWorker, pSocketDriver, osHandle, pParent)
AuSPtr<ISocketServer> pParent,
SocketServer *pParent2) :
SocketBase(pInterface, pWorker, pSocketDriver, osHandle, pParent, pParent2)
{
}
@ -80,7 +81,7 @@ namespace Aurora::IO::Net
return;
}
if (this->bHasRemoteMany_ && this->connectMany_.ips.size())
if (this->bHasRemoteMany_ && this->connectMany_.names.size())
{
if (this->connectMany_.names[0].byEndpoint)
{

View File

@ -62,7 +62,7 @@ namespace Aurora::IO::Net
AuSPtr<ISocketDriver> GetUserDriver() override;
AuSPtr<INetWorker> GetLockedWorkerThread();
AuSPtr<INetWorker> GetLockedWorkerThread() override;
const NetEndpoint &GetRemoteEndpoint() override;
const NetEndpoint &GetLocalEndpoint() override;

View File

@ -666,7 +666,7 @@ namespace Aurora::IO::Net
pOutput->OnFailure((void *)nullptr);
if (this->pRetargetInput == pOutput)
{
this->pRetargetInput = {};
AuResetMember(this->pRetargetInput);
}
}
}
@ -684,7 +684,7 @@ namespace Aurora::IO::Net
pInput->OnFailure((void *)nullptr);
if (this->pRetargetOutput == pInput)
{
this->pRetargetOutput = {};
AuResetMember(this->pRetargetOutput);
}
}
}
@ -713,7 +713,7 @@ namespace Aurora::IO::Net
pOutput->OnFailure((void *)nullptr);
if (this->pRetargetInput == pOutput)
{
this->pRetargetInput = {};
AuResetMember(this->pRetargetInput);
}
}
return;
@ -749,7 +749,7 @@ namespace Aurora::IO::Net
if (this->pRetargetOutput == pInput)
{
this->pRetargetOutput = {};
AuResetMember(this->pRetargetOutput);
}
}

View File

@ -105,11 +105,11 @@ namespace Aurora::IO::Net
AuOptional<AuUInt32> NetSocketServerLimits::GetAutoBanTimeSecs()
{
return this->optAutoBanOnDDoSDetectA;
return this->optAutoBanTimeSecs;
}
AuOptional<AuUInt32> NetSocketServerLimits::SetAutoBanTimeSecs(AuOptional<AuUInt32> optNextValue)
{
return AuExchange(this->optAutoBanOnDDoSDetectA, optNextValue);
return AuExchange(this->optAutoBanTimeSecs, optNextValue);
}
}

View File

@ -639,7 +639,7 @@ namespace Aurora::Process
auto ret = reinterpret_cast<AuMach>(pGetProcAddress(reinterpret_cast<HMODULE>(pHandle), symbol.c_str()));
#else
auto ret = reinterpret_cast<AuMach>(dlsym(hapHandlendle, symbol.c_str()));
auto ret = reinterpret_cast<AuMach>(dlsym(pHandle, symbol.c_str()));
#endif
return ret;
}

View File

@ -10,6 +10,8 @@
namespace Aurora::RNG
{
static const double kDblEpsilon = 2.2204460492503131e-16;
RandomDevice::RandomDevice()
{
@ -282,7 +284,7 @@ namespace Aurora::RNG
double RandomDevice::NextDecimal()
{
return this->UniformFloatInRange(DBL_EPSILON, 1.0);
return this->UniformFloatInRange(kDblEpsilon, 1.0);
}
AuUInt32 RandomDevice::NextIndex(AuUInt32 uCount /* = max + 1*/)
@ -300,7 +302,7 @@ namespace Aurora::RNG
double RandomDevice::NextNumber(double dMin, double dMax)
{
auto dRange = dMax - dMin;
return this->UniformFloatInRange(DBL_EPSILON, dRange + DBL_EPSILON) + dMin - DBL_EPSILON;
return this->UniformFloatInRange(kDblEpsilon, dRange + kDblEpsilon) + dMin - kDblEpsilon;
}
AuMemoryViewRead RandomDevice::ToSeed()