diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-05-01 19:55:09 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-05-01 19:55:09 -0700 |
commit | cc6763ec4ebab535ade9edeb932c9d90c070ac4e (patch) | |
tree | b32010347fda33e45cde6098555c71f4f9166703 | |
parent | f54612a210af5c85071d54d892d533656a940c7c (diff) |
undef __linux__, fixes SDL endianness detection
-rwxr-xr-x | tests/runner.py | 13 | ||||
-rw-r--r-- | tools/shared.py | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py index a5b5ad84..69f996ca 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -6612,6 +6612,19 @@ f.close() Popen(['python', EMCC, os.path.join(self.get_dir(), 'main.cpp'), '--pre-js', 'before.js', '--post-js', 'after.js']).communicate() self.assertContained('hello from main\nhello from js\n', run_js(os.path.join(self.get_dir(), 'a.out.js'))) + def test_sdl_endianness(self): + open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write(r''' + #include <stdio.h> + #include <SDL/SDL.h> + + int main() { + printf("%d, %d, %d\n", SDL_BYTEORDER, SDL_LIL_ENDIAN, SDL_BIG_ENDIAN); + return 0; + } + ''') + Popen(['python', EMCC, os.path.join(self.get_dir(), 'main.cpp')]).communicate() + self.assertContained('1234, 1234, 4321\n', run_js(os.path.join(self.get_dir(), 'a.out.js'))) + def test_prepost(self): open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write(''' #include <stdio.h> diff --git a/tools/shared.py b/tools/shared.py index 010351ee..b4dc71ca 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -199,7 +199,7 @@ if USE_EMSDK: '-Xclang', '-isystem' + path_from_root('system', 'include', 'net'), '-Xclang', '-isystem' + path_from_root('system', 'include', 'SDL'), ] + [ - '-U__APPLE__' + '-U__APPLE__', '-U__linux__' ] COMPILER_OPTS += EMSDK_OPTS else: |