rewrite QEMU_BUILD_BUG_ON
On some platforms, __LINE__ will not expand to real number in QEMU_BUILD_BUG_ON, so if using QEMU_BUILD_BUG_ON twice, compiler will report errors. This patch will fix it. BTW, I got error message on RHEL 6.1/gcc 4.4.5. Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
		
							parent
							
								
									75bab85ca0
								
							
						
					
					
						commit
						ea8f978ffe
					
				| 
						 | 
					@ -30,8 +30,10 @@
 | 
				
			||||||
# define QEMU_PACKED __attribute__((packed))
 | 
					# define QEMU_PACKED __attribute__((packed))
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define cat(x,y) x ## y
 | 
				
			||||||
 | 
					#define cat2(x,y) cat(x,y)
 | 
				
			||||||
#define QEMU_BUILD_BUG_ON(x) \
 | 
					#define QEMU_BUILD_BUG_ON(x) \
 | 
				
			||||||
    typedef char qemu_build_bug_on__##__LINE__[(x)?-1:1];
 | 
					    typedef char cat2(qemu_build_bug_on__,__LINE__)[(x)?-1:1];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined __GNUC__
 | 
					#if defined __GNUC__
 | 
				
			||||||
# if !QEMU_GNUC_PREREQ(4, 4)
 | 
					# if !QEMU_GNUC_PREREQ(4, 4)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue