Skip to content

Commit 6a54aac

Browse files
committed
Fix: Try strtoull over stoull for MSVC
error C2039: 'stoull': is not a member of 'std'
1 parent ef9f501 commit 6a54aac

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
@@ -267,10 +267,10 @@ int main(void) {
267267
auto const threads_str = std::getenv("NBODY_THREADS");
268268

269269
// Parse env vars and validate
270-
std::size_t n = std::stoull(n_str ? n_str : "0");
271-
std::size_t const iterations = std::stoull(iterations_str ? iterations_str : "1000");
270+
std::size_t n = std::strtoull(n_str ? n_str : "0", nullptr, 10);
271+
std::size_t const iterations = std::strtoull(iterations_str ? iterations_str : "1000", nullptr, 10);
272272
std::string_view const backend = backend_str ? backend_str : "fork_union_static";
273-
std::size_t threads = std::stoull(threads_str ? threads_str : "0");
273+
std::size_t threads = std::strtoull(threads_str ? threads_str : "0", nullptr, 10);
274274
if (threads == 0) threads = std::thread::hardware_concurrency();
275275
if (n == 0) n = threads;
276276

0 commit comments

Comments
 (0)