File tree Expand file tree Collapse file tree 6 files changed +46
-8
lines changed Expand file tree Collapse file tree 6 files changed +46
-8
lines changed Original file line number Diff line number Diff line change @@ -350,3 +350,39 @@ jobs:
350
350
emmake make -C build qjs_wasm -j$(getconf _NPROCESSORS_ONLN)
351
351
- name : result
352
352
run : ls -lh build
353
+
354
+ cygwin :
355
+ runs-on : windows-latest
356
+ defaults :
357
+ run :
358
+ shell : C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
359
+ steps :
360
+ - name : Set up Cygwin
361
+ uses : cygwin/cygwin-install-action@master
362
+ with :
363
+ packages : make cmake gcc-g++ bash
364
+
365
+ - uses : actions/checkout@v3
366
+
367
+ - name : build
368
+
369
+ # Plain `make` fails here with this error:
370
+ # No rule to make target '/cygdrive/d/a/quickjs-ng/quickjs-ng/cutils.c',
371
+ # needed by 'CMakeFiles/qjs.dir/cutils.c.o'. Stop.
372
+ #
373
+ # For some reason, making the build directory then `make`ing in there
374
+ # fixes it.
375
+ run : |
376
+ cd $GITHUB_WORKSPACE
377
+ make build/CMakeCache.txt
378
+ make --directory build
379
+
380
+ - name : stats
381
+ run : |
382
+ cd $GITHUB_WORKSPACE
383
+ make --debug stats
384
+
385
+ - name : test
386
+ run : |
387
+ cd $GITHUB_WORKSPACE
388
+ make --debug test
Original file line number Diff line number Diff line change 36
36
#include <time.h>
37
37
#if defined(__APPLE__ )
38
38
#include <malloc/malloc.h>
39
- #elif defined(__linux__ )
39
+ #elif defined(__linux__ ) || defined( __CYGWIN__ )
40
40
#include <malloc.h>
41
41
#endif
42
42
@@ -259,7 +259,7 @@ static const JSMallocFunctions trace_mf = {
259
259
(size_t (* )(const void * ))_msize ,
260
260
#elif defined(EMSCRIPTEN )
261
261
NULL ,
262
- #elif defined(__linux__ )
262
+ #elif defined(__linux__ ) || defined ( __CYGWIN__ )
263
263
(size_t (* )(const void * ))malloc_usable_size ,
264
264
#else
265
265
/* change this to `NULL,` if compilation fails */
Original file line number Diff line number Diff line change @@ -3582,6 +3582,8 @@ void js_std_set_worker_new_context_func(JSContext *(*func)(JSRuntime *rt))
3582
3582
#define OS_PLATFORM "darwin"
3583
3583
#elif defined(EMSCRIPTEN )
3584
3584
#define OS_PLATFORM "js"
3585
+ #elif defined(__CYGWIN__ )
3586
+ #define OS_PLATFORM "cygwin"
3585
3587
#else
3586
3588
#define OS_PLATFORM "linux"
3587
3589
#endif
Original file line number Diff line number Diff line change 38
38
#include <math.h>
39
39
#if defined(__APPLE__)
40
40
#include <malloc/malloc.h>
41
- #elif defined(__linux__)
41
+ #elif defined(__linux__) || defined(__CYGWIN__)
42
42
#include <malloc.h>
43
43
#elif defined(__FreeBSD__)
44
44
#include <malloc_np.h>
@@ -1722,7 +1722,7 @@ static const JSMallocFunctions def_malloc_funcs = {
1722
1722
(size_t (*)(const void *))_msize,
1723
1723
#elif defined(EMSCRIPTEN)
1724
1724
NULL,
1725
- #elif defined(__linux__)
1725
+ #elif defined(__linux__) || defined (__CYGWIN__)
1726
1726
(size_t (*)(const void *))malloc_usable_size,
1727
1727
#else
1728
1728
/* change this to `NULL,` if compilation fails */
Original file line number Diff line number Diff line change @@ -1668,7 +1668,7 @@ int run_test(const char *filename, int index)
1668
1668
/* XXX: should extract the phase */
1669
1669
char * q = find_tag (p , "type:" , & state );
1670
1670
if (q ) {
1671
- while (isspace (* q ))
1671
+ while (isspace (( unsigned char ) * q ))
1672
1672
q ++ ;
1673
1673
error_type = strdup_len (q , strcspn (q , " \n" ));
1674
1674
}
@@ -2089,7 +2089,7 @@ int main(int argc, char **argv)
2089
2089
update_exclude_dirs ();
2090
2090
2091
2091
if (is_dir_list ) {
2092
- if (optind < argc && !isdigit (argv [optind ][0 ])) {
2092
+ if (optind < argc && !isdigit (( unsigned char ) argv [optind ][0 ])) {
2093
2093
filename = argv [optind ++ ];
2094
2094
namelist_load (& test_list , filename );
2095
2095
}
Original file line number Diff line number Diff line change @@ -345,8 +345,8 @@ function test_number()
345
345
assert ( Number . isNaN ( Number ( "-" ) ) ) ;
346
346
assert ( Number . isNaN ( Number ( "\x00a" ) ) ) ;
347
347
348
- // TODO: Fix rounding errors on Windows.
349
- if ( os . platform === 'win32' ) {
348
+ // TODO: Fix rounding errors on Windows/Cygwin .
349
+ if ( [ 'win32' , 'cygwin' ] . includes ( os . platform ) ) {
350
350
return ;
351
351
}
352
352
You can’t perform that action at this time.
0 commit comments