aboutsummaryrefslogtreecommitdiff
path: root/windows/tcc_stubs.c
diff options
context:
space:
mode:
authorCNLohr <lohr85@gmail.com>2017-03-17 01:33:26 -0400
committerCNLohr <lohr85@gmail.com>2017-03-17 01:33:29 -0400
commitd84be3e09ce89a291f5b9eb04e6cc1fd34a00541 (patch)
tree83675cbe1fe7276c8abbc58652a4fc260f6cf9d0 /windows/tcc_stubs.c
parent1837afbe2aa17af10fa508d71807912b0da6ec50 (diff)
downloadlibsurvive-d84be3e09ce89a291f5b9eb04e6cc1fd34a00541.tar.gz
libsurvive-d84be3e09ce89a291f5b9eb04e6cc1fd34a00541.tar.bz2
Remove winbuild folder.
Diffstat (limited to 'windows/tcc_stubs.c')
-rw-r--r--windows/tcc_stubs.c59
1 files changed, 0 insertions, 59 deletions
diff --git a/windows/tcc_stubs.c b/windows/tcc_stubs.c
deleted file mode 100644
index 7872914..0000000
--- a/windows/tcc_stubs.c
+++ /dev/null
@@ -1,59 +0,0 @@
-
-#include <_mingw.h>
-
-#define REMATH(x) double __cdecl x( double f ); float x##f(float v) { return x(v); }
-
-REMATH( acos );
-REMATH( cos );
-REMATH( sin );
-REMATH( sqrt );
-REMATH( asin );
-
-double __cdecl strtod (const char* str, char** endptr);
-float strtof( const char* str, char** endptr)
-{
- return strtod( str, endptr );
-}
-
-double __cdecl atan2(double a, double b);
-float atan2f(float a, float b)
-{
- return atan2( a, b );
-}
-
-//From http://stackoverflow.com/questions/40159892/using-asprintf-on-windows
-int __cdecl vsprintf_s(
- char *buffer,
- size_t numberOfElements,
- const char *format,
- va_list argptr
-);
-
-int asprintf(char **strp, const char *fmt, ...) {
- va_list ap;
- va_start(ap, fmt);
- int r = vasprintf(strp, fmt, ap);
- va_end(ap);
- return r;
-}
-
-int vasprintf(char **strp, const char *fmt, va_list ap) {
- // _vscprintf tells you how big the buffer needs to be
- int len = _vscprintf(fmt, ap);
- if (len == -1) {
- return -1;
- }
- size_t size = (size_t)len + 1;
- char *str = (char*)malloc(size);
- if (!str) {
- return -1;
- }
- // _vsprintf_s is the "secure" version of vsprintf
- int r = vsprintf_s(str, len + 1, fmt, ap);
- if (r == -1) {
- free(str);
- return -1;
- }
- *strp = str;
- return r;
-} \ No newline at end of file