mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Use (and ignore) the expression provided to log_debug in NDEBUG builds.
This commit is contained in:
		
							parent
							
								
									2ffdb74fb1
								
							
						
					
					
						commit
						21692c4a2e
					
				
					 1 changed files with 1 additions and 2 deletions
				
			
		| 
						 | 
					@ -157,11 +157,10 @@ void log_warning_noprefix(const char *format, ...) YS_ATTRIBUTE(format(printf, 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef NDEBUG
 | 
					#ifndef NDEBUG
 | 
				
			||||||
static inline bool ys_debug(int n = 0) { if (log_force_debug) return true; log_debug_suppressed += n; return false; }
 | 
					static inline bool ys_debug(int n = 0) { if (log_force_debug) return true; log_debug_suppressed += n; return false; }
 | 
				
			||||||
#  define log_debug(...) do { if (ys_debug(1)) log(__VA_ARGS__); } while (0)
 | 
					 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
static inline bool ys_debug(int = 0) { return false; }
 | 
					static inline bool ys_debug(int = 0) { return false; }
 | 
				
			||||||
#  define log_debug(_fmt, ...) do { } while (0)
 | 
					 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					#  define log_debug(...) do { if (ys_debug(1)) log(__VA_ARGS__); } while (0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline void log_suppressed() {
 | 
					static inline void log_suppressed() {
 | 
				
			||||||
	if (log_debug_suppressed && !log_make_debug) {
 | 
						if (log_debug_suppressed && !log_make_debug) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue