Skip to content

Commit fe330d2

Browse files
committed
Fix: MSVC has no std::stoul, only 64-bit
1 parent 2d41131 commit fe330d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/nbody.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,10 @@ int main(void) {
261261
std::printf("Welcome to the Fork Union N-Body simulation!\n");
262262

263263
// Read env vars
264-
std::size_t n = std::stoul(std::getenv("NBODY_COUNT") ?: "0");
265-
std::size_t const iterations = std::stoul(std::getenv("NBODY_ITERATIONS") ?: "1000");
264+
std::size_t n = std::stoull(std::getenv("NBODY_COUNT") ?: "0");
265+
std::size_t const iterations = std::stoull(std::getenv("NBODY_ITERATIONS") ?: "1000");
266266
std::string_view const backend = std::getenv("NBODY_BACKEND") ? std::getenv("NBODY_BACKEND") : "fork_union_static";
267-
std::size_t threads = std::stoul(std::getenv("NBODY_THREADS") ?: "0");
267+
std::size_t threads = std::stoull(std::getenv("NBODY_THREADS") ?: "0");
268268
if (threads == 0) threads = std::thread::hardware_concurrency();
269269
if (n == 0) n = threads;
270270

0 commit comments

Comments
 (0)