diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-09-25 14:22:22 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-09-25 14:22:22 -0700 |
commit | 72fdbfde418c3496ffe810fbb0fb5f48adcf2a0f (patch) | |
tree | d2e7f0dc2c12458a97e877c4dfc122b5fae46b7e | |
parent | 0d423cd35b930cbc70806e90a4583ad70d552a11 (diff) |
fix dirent.h and folders test
-rw-r--r-- | system/include/libc/dirent.h | 3 | ||||
-rw-r--r-- | system/include/libc/sys/dirent.h | 18 | ||||
-rw-r--r-- | tests/runner.py | 3 | ||||
-rw-r--r-- | tools/shared.py | 2 |
4 files changed, 20 insertions, 6 deletions
diff --git a/system/include/libc/dirent.h b/system/include/libc/dirent.h index 6fefc03c..97700f30 100644 --- a/system/include/libc/dirent.h +++ b/system/include/libc/dirent.h @@ -3,12 +3,13 @@ #ifdef __cplusplus extern "C" { #endif -#include <sys/dirent.h> #if !defined(MAXNAMLEN) && !defined(_POSIX_SOURCE) #define MAXNAMLEN 1024 #endif +#include <sys/dirent.h> + #ifdef __cplusplus } #endif diff --git a/system/include/libc/sys/dirent.h b/system/include/libc/sys/dirent.h index a3fb5c02..5dc42ebe 100644 --- a/system/include/libc/sys/dirent.h +++ b/system/include/libc/sys/dirent.h @@ -7,7 +7,23 @@ #ifdef __cplusplus extern "C" { #endif -#error "<dirent.h> not supported" + +struct DIR; + +/* XXX Emscripten */ +struct dirent { + ino_t d_ino; + char d_name[MAXNAMLEN]; + int d_off; + int d_reclen; + char d_type; +}; + +DIR *opendir(const char *); +void seekdir(DIR *, long); +long telldir(DIR *); +struct dirent *readdir(DIR *); + #ifdef __cplusplus } #endif diff --git a/tests/runner.py b/tests/runner.py index c86997d6..a09008df 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -140,9 +140,6 @@ class RunnerCore(unittest.TestCase): # the additional files were copied; alter additional_files to point to their full paths now additional_files = map(lambda f: os.path.join(dirname, f), additional_files) - # Copy Emscripten C++ API - shutil.copy(path_from_root('src', 'include', 'emscripten.h'), dirname) - # C++ => LLVM binary os.chdir(dirname) cwd = os.getcwd() diff --git a/tools/shared.py b/tools/shared.py index bc767c82..9eeb1552 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -34,9 +34,9 @@ COMPILER_OPTS = COMPILER_OPTS + ['-m32', '-v', '-U__i386__', '-U__x86_64__', '-U if USE_EMSDK: COMPILER_OPTS += [ '-nostdinc', '-I' + path_from_root('system', 'include'), + '-I' + path_from_root('system', 'include', 'freebsd'), # posix stuff '-I' + path_from_root('system', 'include', 'libc'), '-I' + path_from_root('system', 'include', 'libcxx'), - '-I' + path_from_root('system', 'include', 'freebsd'), # sys/mman.h ] # Engine tweaks |