summaryrefslogtreecommitdiffstats
path: root/apps/plugins/lua/rockconf.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lua/rockconf.h')
-rw-r--r--apps/plugins/lua/rockconf.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/apps/plugins/lua/rockconf.h b/apps/plugins/lua/rockconf.h
index eda1e05084..a13146d7e9 100644
--- a/apps/plugins/lua/rockconf.h
+++ b/apps/plugins/lua/rockconf.h
@@ -25,6 +25,10 @@
#include "plugin.h"
#include <tlsf.h>
+#undef LUAI_THROW
+#undef LUAI_TRY
+#undef luai_jmpbuf
+
#undef LUA_PATH_DEFAULT
#define LUA_PATH_DEFAULT "$/?.lua;" "$/?/init.lua;" VIEWERS_DIR"/lua/?.lua;" VIEWERS_DIR"/lua/?/init.lua;"
@@ -32,11 +36,20 @@
#include "lib/pluginlib_exit.h"
+#define LUAI_THROW(L,c) longjmp((c)->b, 1)
+#define LUAI_TRY(L,c,a) if (setjmp((c)->b) == 0) { a }
+#define luai_jmpbuf jmp_buf
+
extern char curpath[MAX_PATH];
struct tm *gmtime(const time_t *timep);
long strtol(const char *nptr, char **endptr, int base);
unsigned long strtoul(const char *str, char **endptr, int base);
size_t strftime(char* dst, size_t max, const char* format, const struct tm* tm);
+long lfloor(long x);
+long lpow(long x, long y);
+
+#define floor lfloor
+#define pow lpow
/* Simple substitutions */
#define malloc tlsf_malloc
@@ -50,17 +63,5 @@ size_t strftime(char* dst, size_t max, const char* format, const struct tm* tm);
#define strcpy rb->strcpy
#define strlen rb->strlen
-#define getlocaledecpoint() '.'
-#define abort() exit(EXIT_FAILURE)
-#define difftime(t1,t0) ((t1) - (t0))
-#define localtime gmtime
-#if CONFIG_RTC
-#define time(x) mktime(rb->get_time())
-#define mktime rb->mktime
-#else
-#define time(x) (0)
-#define mktime(x) (0)
-#endif
-
#endif /* _ROCKCONF_H_ */