Merge pull request #13 from EOSIO/fix-constants

Fix some constants and allow fprintf to work for stdout/stderr.
This commit is contained in:
swatanabe-b1
2019-10-28 15:57:54 -04:00
committed by GitHub
5 changed files with 15 additions and 4 deletions
+1 -1
View File
@@ -11,7 +11,7 @@
#endif
typedef size_t ssize_t;
typedef ptrdiff_t ssize_t;
typedef __builtin_va_list va_list;
typedef __builtin_va_list __isoc_va_list;
+1 -1
View File
@@ -1,7 +1,7 @@
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define PAGE_SIZE 4096
#define LONG_BIT 64
#define LONG_BIT 32
#endif
#define LONG_MAX 0x7fffffffL
+2 -2
View File
@@ -5,8 +5,8 @@
extern "C" {
#endif
int __flt_rounds(void);
#define FLT_ROUNDS (__flt_rounds())
/* WASM doesn't support changing the rounding mode dynamically */
#define FLT_ROUNDS 1
#define FLT_RADIX 2
+7
View File
@@ -740,3 +740,10 @@ int fctprintf(void (*out)(char character, void* arg), void* arg, const char* for
va_end(va);
return ret;
}
int vfprintf(FILE *restrict f, const char *restrict fmt, va_list ap)
{
char buffer[1];
return _vsnprintf(_out_char, buffer, (size_t)-1, fmt, ap);
}
+4
View File
@@ -12,6 +12,8 @@
/* Some useful macros */
#if 0
#define MAX(a,b) ((a)>(b) ? (a) : (b))
#define MIN(a,b) ((a)<(b) ? (a) : (b))
@@ -691,3 +693,5 @@ int vfprintf(FILE *restrict f, const char *restrict fmt, va_list ap)
va_end(ap2);
return ret;
}
#endif