1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-27 17:00:27 +00:00

Merge pull request #740 from yumaikas/hotfix-new-style-math-bindings

Fix macro stringification for one-arg math functions
This commit is contained in:
Calvin Rose 2021-07-27 23:56:16 -05:00 committed by GitHub
commit 28fb76e602
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -256,7 +256,7 @@ JANET_CORE_FN(janet_srand,
} }
#define JANET_DEFINE_MATHOP(name, fop, doc)\ #define JANET_DEFINE_MATHOP(name, fop, doc)\
JANET_CORE_FN(janet_##name, "(math/##name x)", doc) {\ JANET_CORE_FN(janet_##name, "(math/" #name " x)", doc) {\
janet_fixarity(argc, 1); \ janet_fixarity(argc, 1); \
double x = janet_getnumber(argv, 0); \ double x = janet_getnumber(argv, 0); \
return janet_wrap_number(fop(x)); \ return janet_wrap_number(fop(x)); \