mirror of
https://github.com/Zygo/bees.git
synced 2025-06-15 17:26:15 +02:00
build: OK, maybe 32-bit machines could work
I accidentally did a pre-push verification on a 32-bit build host. There were a surprisingly small number of problems, so fix them. Bees now builds on a 32-bit host. Let's not update README just yet, though: the 32-bit ioctl support fails immediately after startup on a 64-bit kernel.
This commit is contained in:
@ -126,7 +126,13 @@ test_cast_0x80000000_to_things()
|
||||
{
|
||||
auto sv = 0x80000000LL;
|
||||
auto uv = 0x80000000ULL;
|
||||
SHOULD_PASS(ranged_cast<off_t>(sv), sv);
|
||||
if (sizeof(off_t) == 4) {
|
||||
SHOULD_FAIL(ranged_cast<off_t>(sv));
|
||||
} else if (sizeof(off_t) == 8) {
|
||||
SHOULD_PASS(ranged_cast<off_t>(sv), sv);
|
||||
} else {
|
||||
assert(!"unhandled case, please add code for off_t here");
|
||||
}
|
||||
SHOULD_PASS(ranged_cast<uint64_t>(uv), uv);
|
||||
SHOULD_PASS(ranged_cast<uint32_t>(uv), uv);
|
||||
SHOULD_FAIL(ranged_cast<uint16_t>(uv));
|
||||
@ -141,7 +147,13 @@ test_cast_0x80000000_to_things()
|
||||
SHOULD_FAIL(ranged_cast<unsigned short>(uv));
|
||||
SHOULD_FAIL(ranged_cast<unsigned char>(uv));
|
||||
SHOULD_PASS(ranged_cast<signed long long>(sv), sv);
|
||||
SHOULD_PASS(ranged_cast<signed long>(sv), sv);
|
||||
if (sizeof(long) == 4) {
|
||||
SHOULD_FAIL(ranged_cast<signed long>(sv));
|
||||
} else if (sizeof(long) == 8) {
|
||||
SHOULD_PASS(ranged_cast<signed long>(sv), sv);
|
||||
} else {
|
||||
assert(!"unhandled case, please add code for long here");
|
||||
}
|
||||
SHOULD_FAIL(ranged_cast<signed short>(sv));
|
||||
SHOULD_FAIL(ranged_cast<signed char>(sv));
|
||||
if (sizeof(int) == 4) {
|
||||
@ -149,7 +161,7 @@ test_cast_0x80000000_to_things()
|
||||
} else if (sizeof(int) == 8) {
|
||||
SHOULD_PASS(ranged_cast<signed int>(sv), sv);
|
||||
} else {
|
||||
assert(!"unhandled case, please add code here");
|
||||
assert(!"unhandled case, please add code for int here");
|
||||
}
|
||||
}
|
||||
|
||||
@ -159,7 +171,13 @@ test_cast_0xffffffff_to_things()
|
||||
{
|
||||
auto sv = 0xffffffffLL;
|
||||
auto uv = 0xffffffffULL;
|
||||
SHOULD_PASS(ranged_cast<off_t>(sv), sv);
|
||||
if (sizeof(off_t) == 4) {
|
||||
SHOULD_FAIL(ranged_cast<off_t>(sv));
|
||||
} else if (sizeof(off_t) == 8) {
|
||||
SHOULD_PASS(ranged_cast<off_t>(sv), sv);
|
||||
} else {
|
||||
assert(!"unhandled case, please add code for off_t here");
|
||||
}
|
||||
SHOULD_PASS(ranged_cast<uint64_t>(uv), uv);
|
||||
SHOULD_PASS(ranged_cast<uint32_t>(uv), uv);
|
||||
SHOULD_FAIL(ranged_cast<uint16_t>(uv));
|
||||
@ -174,7 +192,13 @@ test_cast_0xffffffff_to_things()
|
||||
SHOULD_FAIL(ranged_cast<unsigned short>(uv));
|
||||
SHOULD_FAIL(ranged_cast<unsigned char>(uv));
|
||||
SHOULD_PASS(ranged_cast<signed long long>(sv), sv);
|
||||
SHOULD_PASS(ranged_cast<signed long>(sv), sv);
|
||||
if (sizeof(long) == 4) {
|
||||
SHOULD_FAIL(ranged_cast<signed long>(sv));
|
||||
} else if (sizeof(long) == 8) {
|
||||
SHOULD_PASS(ranged_cast<signed long>(sv), sv);
|
||||
} else {
|
||||
assert(!"unhandled case, please add code for long here");
|
||||
}
|
||||
SHOULD_FAIL(ranged_cast<signed short>(sv));
|
||||
SHOULD_FAIL(ranged_cast<signed char>(sv));
|
||||
if (sizeof(int) == 4) {
|
||||
@ -182,7 +206,7 @@ test_cast_0xffffffff_to_things()
|
||||
} else if (sizeof(int) == 8) {
|
||||
SHOULD_PASS(ranged_cast<signed int>(sv), sv);
|
||||
} else {
|
||||
assert(!"unhandled case, please add code here");
|
||||
assert(!"unhandled case, please add code for int here");
|
||||
}
|
||||
}
|
||||
|
||||
@ -192,7 +216,13 @@ test_cast_0xfffffffff_to_things()
|
||||
{
|
||||
auto sv = 0xfffffffffLL;
|
||||
auto uv = 0xfffffffffULL;
|
||||
SHOULD_PASS(ranged_cast<off_t>(sv), sv);
|
||||
if (sizeof(off_t) == 4) {
|
||||
SHOULD_FAIL(ranged_cast<off_t>(sv));
|
||||
} else if (sizeof(off_t) == 8) {
|
||||
SHOULD_PASS(ranged_cast<off_t>(sv), sv);
|
||||
} else {
|
||||
assert(!"unhandled case, please add code for off_t here");
|
||||
}
|
||||
SHOULD_PASS(ranged_cast<uint64_t>(uv), uv);
|
||||
SHOULD_FAIL(ranged_cast<uint32_t>(uv));
|
||||
SHOULD_FAIL(ranged_cast<uint16_t>(uv));
|
||||
|
Reference in New Issue
Block a user