Skip to content

Commit

Permalink
Fix #preprocess detection on windows (emscripten-core#21284)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbc100 authored Feb 7, 2024
1 parent e5516dd commit 21f2533
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/jsifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ function getTransitiveDeps(symbol) {
}

function shouldPreprocess(fileName) {
return read(fileName).trim().startsWith('#preprocess\n');
var content = read(fileName).trim()
return content.startsWith('#preprocess\n') || content.startsWith('#preprocess\r\n');
}

function preJS() {
Expand Down
1 change: 1 addition & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -14472,6 +14472,7 @@ def test_wasm64_no_asan(self):
err = self.expect_fail([EMCC, test_file('hello_world.c'), '-sMEMORY64', '-fsanitize=address'])
self.assertContained('error: MEMORY64 does not yet work with ASAN', err)

@crossplatform
def test_js_preprocess_pre_post(self):
create_file('pre.js', '''
#preprocess
Expand Down

0 comments on commit 21f2533

Please sign in to comment.