Kernel: Add constexpr conditional debug prints
This commit is contained in:
		
							parent
							
								
									c9e09b840e
								
							
						
					
					
						commit
						9a3286ad57
					
				|  | @ -29,6 +29,24 @@ | |||
| 		Debug::DebugLock::unlock();							\ | ||||
| 	} while(false) | ||||
| 
 | ||||
| #define dprintln_if(cond, ...)		\ | ||||
| 	do {							\ | ||||
| 		if constexpr(cond)			\ | ||||
| 			dprintln(__VA_ARGS__);	\ | ||||
| 	} while(false) | ||||
| 
 | ||||
| #define dwarnln_if(cond, ...)		\ | ||||
| 	do {							\ | ||||
| 		if constexpr(cond)			\ | ||||
| 			dwarnln(__VA_ARGS__);	\ | ||||
| 	} while(false) | ||||
| 
 | ||||
| #define derrorln_if(cond, ...)		\ | ||||
| 	do {							\ | ||||
| 		if constexpr(cond)			\ | ||||
| 			derrorln(__VA_ARGS__);	\ | ||||
| 	} while(false) | ||||
| 
 | ||||
| #define BOCHS_BREAK() asm volatile("xchgw %bx, %bx") | ||||
| 
 | ||||
| namespace Debug | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue