Fix handling of unsupported math functions

This commit is contained in:
Nicolas Williams committed 2017-02-04 00:11:10 -06:00
1 parent 2fb099e4cf
commit 125071cf00
1 file changed
+15 -2
+15 -2
View File
@@ -1375,12 +1375,25 @@ static block bind_bytecoded_builtins(block b) {
#define LIBM_DD(name) "def " #name ": _" #name ";"
#define LIBM_DDD(name) "def " #name "(a;b): _" #name "(a;b);"
#define LIBM_DD_NO(name) "def " #name ": \"Error: " #name "() not found at build time\"|error;"
#define LIBM_DDD_NO(name) "def " #name "(a;b): \"Error: " #name "() not found at build time\"|error;"
#define LIBM_DD_NO(name)
#define LIBM_DDD_NO(name)
static const char* const jq_builtins =
/* Include supported math functions first */
#include "libm.h"
/* Include jq-coded builtins next (some depend on math) */
#include "src/builtin.inc"
/* Include unsupported math functions next */
#undef LIBM_DDD_NO
#undef LIBM_DD_NO
#undef LIBM_DDD
#undef LIBM_DD
#define LIBM_DD(name)
#define LIBM_DDD(name)
#define LIBM_DD_NO(name) "def " #name ": \"Error: " #name "() not found at build time\"|error;"
#define LIBM_DDD_NO(name) "def " #name "(a;b): \"Error: " #name "() not found at build time\"|error;"
#include "libm.h"
;
#undef LIBM_DDD_NO