mirror of
				https://github.com/eledio-devices/thirdparty-littlefs.git
				synced 2025-10-31 16:14:16 +01:00 
			
		
		
		
	Merge pull request #322 from hemmick/master
Allow debug prints without __VA_ARGS__ in non-MSVC
This commit is contained in:
		
							
								
								
									
										28
									
								
								lfs_util.h
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								lfs_util.h
									
									
									
									
									
								
							| @@ -50,31 +50,35 @@ extern "C" | |||||||
|  |  | ||||||
| // Logging functions | // Logging functions | ||||||
| #ifdef LFS_YES_TRACE | #ifdef LFS_YES_TRACE | ||||||
| #define LFS_TRACE(fmt, ...) \ | #define LFS_TRACE_(fmt, ...) \ | ||||||
|     printf("lfs_trace:%d: " fmt "\n", __LINE__, __VA_ARGS__) |     printf("lfs_trace:%d: " fmt "%s\n", __LINE__, __VA_ARGS__) | ||||||
|  | #define LFS_TRACE(...) LFS_TRACE_(__VA_ARGS__, "") | ||||||
| #else | #else | ||||||
| #define LFS_TRACE(fmt, ...) | #define LFS_TRACE(...) | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #ifndef LFS_NO_DEBUG | #ifndef LFS_NO_DEBUG | ||||||
| #define LFS_DEBUG(fmt, ...) \ | #define LFS_DEBUG_(fmt, ...) \ | ||||||
|     printf("lfs_debug:%d: " fmt "\n", __LINE__, __VA_ARGS__) |     printf("lfs_debug:%d: " fmt "%s\n", __LINE__, __VA_ARGS__) | ||||||
|  | #define LFS_DEBUG(...) LFS_DEBUG_(__VA_ARGS__, "") | ||||||
| #else | #else | ||||||
| #define LFS_DEBUG(fmt, ...) | #define LFS_DEBUG(...) | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #ifndef LFS_NO_WARN | #ifndef LFS_NO_WARN | ||||||
| #define LFS_WARN(fmt, ...) \ | #define LFS_WARN_(fmt, ...) \ | ||||||
|     printf("lfs_warn:%d: " fmt "\n", __LINE__, __VA_ARGS__) |     printf("lfs_warn:%d: " fmt "%s\n", __LINE__, __VA_ARGS__) | ||||||
|  | #define LFS_WARN(...) LFS_WARN_(__VA_ARGS__, "") | ||||||
| #else | #else | ||||||
| #define LFS_WARN(fmt, ...) | #define LFS_WARN(...) | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #ifndef LFS_NO_ERROR | #ifndef LFS_NO_ERROR | ||||||
| #define LFS_ERROR(fmt, ...) \ | #define LFS_ERROR_(fmt, ...) \ | ||||||
|     printf("lfs_error:%d: " fmt "\n", __LINE__, __VA_ARGS__) |     printf("lfs_error:%d: " fmt "%s\n", __LINE__, __VA_ARGS__) | ||||||
|  | #define LFS_ERROR(...) LFS_ERROR_(__VA_ARGS__, "") | ||||||
| #else | #else | ||||||
| #define LFS_ERROR(fmt, ...) | #define LFS_ERROR(...) | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| // Runtime assertions | // Runtime assertions | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user