inline pic_eq_p when nan boxing is enabled
This commit is contained in:
		
							parent
							
								
									e7953146c3
								
							
						
					
					
						commit
						2d8980b2d0
					
				
							
								
								
									
										16
									
								
								lib/bool.c
								
								
								
								
							
							
						
						
									
										16
									
								
								lib/bool.c
								
								
								
								
							|  | @ -5,21 +5,7 @@ | |||
| #include "picrin.h" | ||||
| #include "object.h" | ||||
| 
 | ||||
| #if PIC_NAN_BOXING | ||||
| 
 | ||||
| bool | ||||
| pic_eq_p(pic_state *PIC_UNUSED(pic), pic_value x, pic_value y) | ||||
| { | ||||
|   return x.v == y.v; | ||||
| } | ||||
| 
 | ||||
| bool | ||||
| pic_eqv_p(pic_state *PIC_UNUSED(pic), pic_value x, pic_value y) | ||||
| { | ||||
|   return x.v == y.v; | ||||
| } | ||||
| 
 | ||||
| #else | ||||
| #if !PIC_NAN_BOXING | ||||
| 
 | ||||
| bool | ||||
| pic_eq_p(pic_state *PIC_UNUSED(pic), pic_value x, pic_value y) | ||||
|  |  | |||
|  | @ -51,6 +51,9 @@ typedef struct { | |||
| } pic_value; | ||||
| 
 | ||||
| 
 | ||||
| #include "picrin/value.h"       /* inline definitions */ | ||||
| 
 | ||||
| 
 | ||||
| /*
 | ||||
|  * state manipulation | ||||
|  */ | ||||
|  | @ -89,8 +92,6 @@ bool pic_equal_p(pic_state *, pic_value, pic_value); | |||
|  * number, boolean, character, string, bytevector, and userdata | ||||
|  */ | ||||
| 
 | ||||
| #include "picrin/value.h"       /* inline definitions */ | ||||
| 
 | ||||
| typedef struct { | ||||
|   const char *type_name; | ||||
|   void (*dtor)(pic_state *, void *); | ||||
|  |  | |||
|  | @ -242,6 +242,22 @@ pic_id_p(pic_state *pic, pic_value o) | |||
|   return pic_type(pic, o) == PIC_TYPE_ID || pic_sym_p(pic, o); | ||||
| } | ||||
| 
 | ||||
| #if PIC_NAN_BOXING | ||||
| 
 | ||||
| PIC_STATIC_INLINE bool | ||||
| pic_eq_p(pic_state *PIC_UNUSED(pic), pic_value x, pic_value y) | ||||
| { | ||||
|   return x.v == y.v; | ||||
| } | ||||
| 
 | ||||
| PIC_STATIC_INLINE bool | ||||
| pic_eqv_p(pic_state *PIC_UNUSED(pic), pic_value x, pic_value y) | ||||
| { | ||||
|   return x.v == y.v; | ||||
| } | ||||
| 
 | ||||
| #endif | ||||
| 
 | ||||
| #if defined(__cplusplus) | ||||
| } | ||||
| #endif | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Yuichi Nishiwaki
						Yuichi Nishiwaki