1
0
mirror of https://github.com/p2r3/bareiron.git synced 2025-10-01 23:25:09 +02:00

use libc htonll if found

This commit is contained in:
breakgimme
2025-09-12 13:38:48 +02:00
committed by p2r3
parent 5b8360708c
commit 3d02dc02bf

View File

@@ -21,6 +21,7 @@
#include "procedures.h" #include "procedures.h"
#include "tools.h" #include "tools.h"
#ifndef htonll
static uint64_t htonll (uint64_t value) { static uint64_t htonll (uint64_t value) {
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
return ((uint64_t)htonl((uint32_t)(value >> 32))) | return ((uint64_t)htonl((uint32_t)(value >> 32))) |
@@ -29,6 +30,7 @@ static uint64_t htonll (uint64_t value) {
return value; return value;
#endif #endif
} }
#endif
// Keep track of the total amount of bytes received with recv_all // Keep track of the total amount of bytes received with recv_all
// Helps notice misread packets and clean up after errors // Helps notice misread packets and clean up after errors