Skip to content

Commit

Permalink
- MSYS2+clang18でビルドした実行ファイルが落ちる件に対応
Browse files Browse the repository at this point in the history
  - std::chrono::high_resolution_clock::now()を呼び出すとセグフォになる。
 ⇨ 代わりにsteady_clockを用いるようにした。
  std::chrono::steady_clock::now()
  • Loading branch information
yaneurao committed May 27, 2024
1 parent b327a27 commit db3565e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ struct PRNG

// time値とか、thisとか色々加算しておく。
s = (u64)(time(NULL)) + ((u64)(this) << 32)
+ (u64)(std::chrono::high_resolution_clock::now().time_since_epoch().count());
// + (u64)(std::chrono::high_resolution_clock::now().time_since_epoch().count());
// ⇨ MSYS2 + clang18でhigh_resolution_clock::now()を使うとセグフォで落ちるようになった。
// 代わりにsteady_clockを用いる。
+ (u64)std::chrono::steady_clock::now().time_since_epoch().count();
}

// 乱数を一つ取り出す。
Expand Down

0 comments on commit db3565e

Please sign in to comment.