File tree 4 files changed +33
-21
lines changed
4 files changed +33
-21
lines changed Original file line number Diff line number Diff line change @@ -83,8 +83,14 @@ distclean:
83
83
stats : $(QJS )
84
84
$(QJS ) -qd
85
85
86
- # implicitly .PHONY because it doesn't generate output
87
- cxxtest : CXXFLAGS+=-std=c++11 -fsyntax-only -Wall -Wextra -Werror -Wno-unused-parameter
86
+ # effectively .PHONY because it doesn't generate output
87
+ ctest : CFLAGS=-std=c11 -fsyntax-only -Wall -Wextra -Werror -pedantic
88
+ ctest : ctest.c quickjs.h
89
+ $(CC ) $(CFLAGS ) -DJS_NAN_BOXING=0 $<
90
+ $(CC ) $(CFLAGS ) -DJS_NAN_BOXING=1 $<
91
+
92
+ # effectively .PHONY because it doesn't generate output
93
+ cxxtest : CXXFLAGS=-std=c++11 -fsyntax-only -Wall -Wextra -Werror -pedantic
88
94
cxxtest : cxxtest.cc quickjs.h
89
95
$(CXX ) $(CXXFLAGS ) -DJS_NAN_BOXING=0 $<
90
96
$(CXX ) $(CXXFLAGS ) -DJS_NAN_BOXING=1 $<
@@ -116,4 +122,4 @@ unicode_gen: $(BUILD_DIR)
116
122
libunicode-table.h : unicode_gen
117
123
$(BUILD_DIR ) /unicode_gen unicode $@
118
124
119
- .PHONY : all cxxtest debug fuzz install clean codegen distclean stats test test262 test262-update test262-check microbench unicode_gen $(QJS ) $(QJSC )
125
+ .PHONY : all ctest cxxtest debug fuzz install clean codegen distclean stats test test262 test262-update test262-check microbench unicode_gen $(QJS ) $(QJSC )
Original file line number Diff line number Diff line change
1
+ // note: file is not actually compiled, only checked for C syntax errors
2
+ #include "quickjs.h"
3
+
4
+ int main (void )
5
+ {
6
+ JSRuntime * rt = JS_NewRuntime ();
7
+ JSContext * ctx = JS_NewContext (rt );
8
+ JS_FreeValue (ctx , JS_NAN );
9
+ JS_FreeValue (ctx , JS_UNDEFINED );
10
+ JS_FreeValue (ctx , JS_NewFloat64 (ctx , 42 ));
11
+ // not a legal way of using JS_MKPTR but this is here
12
+ // to have the compiler syntax-check its definition
13
+ JS_FreeValue (ctx , JS_MKPTR (JS_TAG_UNINITIALIZED , 0 ));
14
+ JS_FreeContext (ctx );
15
+ JS_FreeRuntime (rt );
16
+ return 0 ;
17
+ }
Original file line number Diff line number Diff line change 1
1
// note: file is not actually compiled, only checked for C++ syntax errors
2
- #include " quickjs.h"
3
-
4
- int main (void )
5
- {
6
- JSRuntime *rt = JS_NewRuntime ();
7
- JSContext *ctx = JS_NewContext (rt);
8
- JS_FreeValue (ctx, JS_NAN);
9
- JS_FreeValue (ctx, JS_UNDEFINED);
10
- JS_FreeValue (ctx, JS_NewFloat64 (ctx, 42 ));
11
- // not a legal way of using JS_MKPTR but this is here
12
- // to have the compiler syntax-check its definition
13
- JS_FreeValue (ctx, JS_MKPTR (JS_TAG_UNINITIALIZED, 0 ));
14
- JS_FreeContext (ctx);
15
- JS_FreeRuntime (rt);
16
- return 0 ;
17
- }
2
+ #include " ctest.c"
Original file line number Diff line number Diff line change @@ -514,21 +514,25 @@ JS_EXTERN int JS_IsRegisteredClass(JSRuntime *rt, JSClassID class_id);
514
514
515
515
static js_force_inline JSValue JS_NewBool (JSContext * ctx , JS_BOOL val )
516
516
{
517
+ (void )& ctx ;
517
518
return JS_MKVAL (JS_TAG_BOOL , (val != 0 ));
518
519
}
519
520
520
521
static js_force_inline JSValue JS_NewInt32 (JSContext * ctx , int32_t val )
521
522
{
523
+ (void )& ctx ;
522
524
return JS_MKVAL (JS_TAG_INT , val );
523
525
}
524
526
525
527
static js_force_inline JSValue JS_NewFloat64 (JSContext * ctx , double val )
526
528
{
529
+ (void )& ctx ;
527
530
return __JS_NewFloat64 (val );
528
531
}
529
532
530
533
static js_force_inline JSValue JS_NewCatchOffset (JSContext * ctx , int32_t val )
531
534
{
535
+ (void )& ctx ;
532
536
return JS_MKVAL (JS_TAG_CATCH_OFFSET , val );
533
537
}
534
538
@@ -566,8 +570,8 @@ static inline JS_BOOL JS_IsNumber(JSValue v)
566
570
567
571
static inline JS_BOOL JS_IsBigInt (JSContext * ctx , JSValue v )
568
572
{
569
- int tag = JS_VALUE_GET_TAG ( v ) ;
570
- return tag == JS_TAG_BIG_INT ;
573
+ ( void ) & ctx ;
574
+ return JS_VALUE_GET_TAG ( v ) == JS_TAG_BIG_INT ;
571
575
}
572
576
573
577
static inline JS_BOOL JS_IsBool (JSValue v )
You can’t perform that action at this time.
0 commit comments