Skip to content

Commit

Permalink
Fix missing C++20 support on SteamOS SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
jhasse committed Jun 12, 2024
1 parent ca837b9 commit d9993d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/audioplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ JNGL_MAIN_BEGIN {
std::ostringstream tmp;
auto secondsPlayed = std::chrono::duration_cast<std::chrono::seconds>(played);
#ifndef __APPLE__ // FIXME: Remove when AppleClang's libc++ supports this C++20 feature
#if __cplusplus >= 202002L // Also remove this when SteamOS SDK supports C++20
tmp << secondsPlayed << " " << std::lround((played - secondsPlayed).count() / 10)
<< "cs\nof " << std::chrono::duration_cast<std::chrono::seconds>(soundFile.length());
#endif
#endif
jngl::print(tmp.str(), jngl::Vec2{ -50, -20 });
if (!soundFile.isPlaying()) {
Expand Down
2 changes: 2 additions & 0 deletions src/jngl/SoundFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ SoundFile::SoundFile(const std::string& filename, std::launch) {
debug(buffer_.size() * sizeof(float) / 1024. / 1024.);
debug(" MB, ");
#ifndef __APPLE__ // FIXME: Remove when AppleClang's libc++ supports this C++20 feature
#if __cplusplus >= 202002L // Also remove this when SteamOS SDK supports C++20
debug(std::chrono::duration_cast<std::chrono::seconds>(length()));
#endif
#endif
debugLn(")");
}
Expand Down

0 comments on commit d9993d5

Please sign in to comment.