summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/rbcompat.h
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2017-08-23 14:20:07 -0400
committerFranklin Wei <git@fwei.tk>2017-08-23 14:22:09 -0400
commit3c514f8e20ea8762025a12f9edbea27967e31d76 (patch)
treeed44527b00a128ce85f507e1abda8dbbbf7de4cb /apps/plugins/puzzles/rbcompat.h
parent4dd300d9f0229269aa8f9a46b07a5aa65f882985 (diff)
downloadrockbox-3c514f8e20ea8762025a12f9edbea27967e31d76.tar.gz
rockbox-3c514f8e20ea8762025a12f9edbea27967e31d76.zip
puzzles: misc. changes and sync with upstream
This brings puzzles up-to-date with Simon's tree, along with the rockbox-specific changes I made. Note that I also got rid of some of the ugly floating-point code in rbwrappers.c and replaced it with wrappers for our fixed-point library. Change-Id: Ibfb79acb15517116a26de1c3ea89e025146b9e2e
Diffstat (limited to 'apps/plugins/puzzles/rbcompat.h')
-rw-r--r--apps/plugins/puzzles/rbcompat.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/apps/plugins/puzzles/rbcompat.h b/apps/plugins/puzzles/rbcompat.h
index 66c86f1cf4..ed1ae87653 100644
--- a/apps/plugins/puzzles/rbcompat.h
+++ b/apps/plugins/puzzles/rbcompat.h
@@ -7,6 +7,8 @@
7 7
8#include <tlsf.h> 8#include <tlsf.h>
9 9
10#undef STR
11
10int sprintf_wrapper(char *str, const char *fmt, ...); 12int sprintf_wrapper(char *str, const char *fmt, ...);
11char *getenv_wrapper(const char *c); 13char *getenv_wrapper(const char *c);
12int puts_wrapper(const char *s); 14int puts_wrapper(const char *s);
@@ -15,7 +17,6 @@ double cos_wrapper(double rads);
15int vsprintf_wrapper(char *s, const char *fmt, va_list ap); 17int vsprintf_wrapper(char *s, const char *fmt, va_list ap);
16float fabs_wrapper(float n); 18float fabs_wrapper(float n);
17float floor_wrapper(float n); 19float floor_wrapper(float n);
18int ftoa(char *buf, int len, float f);
19 20
20float atan_wrapper(float x); 21float atan_wrapper(float x);
21float atan2_wrapper(float y, float x); 22float atan2_wrapper(float y, float x);
@@ -60,14 +61,20 @@ double acos_wrapper(double x);
60#define strchr rb->strchr 61#define strchr rb->strchr
61#define strcmp rb->strcmp 62#define strcmp rb->strcmp
62#define strcpy rb->strcpy 63#define strcpy rb->strcpy
63#define strcspn strcspn_wrapper
64#define strlen rb->strlen 64#define strlen rb->strlen
65#define strspn strspn_wrapper
66#define strtol strtol_wrapper 65#define strtol strtol_wrapper
67#define strtoq strtoq_wrapper 66#define strtoq strtoq_wrapper
68#define strtouq strtouq_wrapper 67#define strtouq strtouq_wrapper
69#define vsprintf vsprintf_wrapper 68#define vsprintf vsprintf_wrapper
70 69
70#ifndef strcspn
71#define strcspn strcspn_wrapper
72#endif
73
74#ifndef strspn /* gcc has builtin */
75#define strspn strspn_wrapper
76#endif
77
71#define abs(x) ((x)<0?-(x):(x)) 78#define abs(x) ((x)<0?-(x):(x))
72 79
73/* work around compilation error */ 80/* work around compilation error */