Skip to content

Commit 1fe2598

Browse files
authored
Include <stdlib.h> in test_fetch_*.cpp files (#26107)
These files use `exit()`, which requires `#include <stdlib.h>`, but didn't have the include. These didn't error out because `libcxx/include/math.h` used to contain `#include <stdlib.h>` but not anymore. It was removed in llvm/llvm-project#139586, which is included in LLVM 21.
1 parent 80d31d0 commit 1fe2598

5 files changed

Lines changed: 5 additions & 0 deletions

File tree

test/fetch/test_fetch_cached_xhr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <stdio.h>
88
#include <math.h>
99
#include <assert.h>
10+
#include <stdlib.h>
1011
#include <emscripten/fetch.h>
1112

1213
int result = 0;

test/fetch/test_fetch_response_headers.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <stdio.h>
88
#include <math.h>
99
#include <assert.h>
10+
#include <stdlib.h>
1011
#include <emscripten/fetch.h>
1112

1213
int result = 1;

test/fetch/test_fetch_stream_file.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <stdio.h>
88
#include <math.h>
99
#include <assert.h>
10+
#include <stdlib.h>
1011
#include <emscripten/fetch.h>
1112

1213
// Compute rudimentary checksum of data

test/fetch/test_fetch_to_indexeddb.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <stdio.h>
88
#include <math.h>
99
#include <assert.h>
10+
#include <stdlib.h>
1011
#include <emscripten/fetch.h>
1112

1213
int main() {

test/fetch/test_fetch_to_memory.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <stdio.h>
88
#include <math.h>
99
#include <assert.h>
10+
#include <stdlib.h>
1011
#include <emscripten/fetch.h>
1112

1213
int result = 1;

0 commit comments

Comments
 (0)