Skip to content

Commit

Permalink
Ensure std::exp can be found after including <cmath>
Browse files Browse the repository at this point in the history
As noted in #462, including <cmath> only guarantees that std::exp is
declared, so calling exp(double) unqualified is not portable. This adds
a using-declaration for std::exp so that unqualified calls are
guaranteed to work.
  • Loading branch information
jwakely committed Aug 10, 2021
1 parent 1c2120c commit df4fe3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/rime/gear/script_translator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

namespace rime {

using std::exp;

namespace {

struct SyllabifyTask {
Expand Down
2 changes: 2 additions & 0 deletions src/rime/gear/table_translator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

namespace rime {

using std::exp;

static const char* kUnitySymbol = " \xe2\x98\xaf ";

// TableTranslation
Expand Down

0 comments on commit df4fe3e

Please sign in to comment.