diff options
-rw-r--r-- | system/include/libc/sys/types.h | 2 | ||||
-rwxr-xr-x | tests/runner.py | 5 | ||||
-rw-r--r-- | tests/systypes/output.txt | 1 | ||||
-rw-r--r-- | tests/systypes/src.c | 20 |
4 files changed, 27 insertions, 1 deletions
diff --git a/system/include/libc/sys/types.h b/system/include/libc/sys/types.h index 734004e7..ab6e895b 100644 --- a/system/include/libc/sys/types.h +++ b/system/include/libc/sys/types.h @@ -134,7 +134,7 @@ typedef unsigned long ino_t; /* XXX Emscripten */ #endif #endif /*__CYGWIN__*/ -#ifdef __MS_types__ +#if defined(__MS_types__) || defined(EMSCRIPTEN) typedef unsigned long vm_offset_t; typedef unsigned long vm_size_t; diff --git a/tests/runner.py b/tests/runner.py index d9953c14..61c98e6b 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -3822,6 +3822,11 @@ def process(filename): expected = open(path_from_root('tests', 'env', 'output.txt'), 'r').read() self.do_run(src, expected) + def test_systypes(self): + src = open(path_from_root('tests', 'systypes', 'src.c'), 'r').read() + expected = open(path_from_root('tests', 'systypes', 'output.txt'), 'r').read() + self.do_run(src, expected) + def test_getloadavg(self): src = r''' #include <stdio.h> diff --git a/tests/systypes/output.txt b/tests/systypes/output.txt new file mode 100644 index 00000000..2e9ba477 --- /dev/null +++ b/tests/systypes/output.txt @@ -0,0 +1 @@ +success diff --git a/tests/systypes/src.c b/tests/systypes/src.c new file mode 100644 index 00000000..a01ed578 --- /dev/null +++ b/tests/systypes/src.c @@ -0,0 +1,20 @@ +#include <sys/types.h> + +// Declare puts manually, we don't want to include any other headers here +#ifdef __cplusplus +extern "C" +#endif +int puts(const char*); + +int main() { + int8_t i8 = 0; + u_int8_t ui8 = 0; + int16_t i16 = 0; + u_int16_t ui16 = 0; + int32_t i32 = 0; + u_int32_t ui32 = 0; + int64_t i64 = 0; + u_int64_t ui64 = 0; + puts("success"); + return 0; +} |