Skip to contentSkip to conversation

kvm tools: Define __compiletime_error helper

PATCH New Cyrill Gorcunov 1 participant 1 message Dec 18, 2011 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm tools: Define __compiletime_error helper

To eliminate compile errors like

 |  CC       builtin-run.o
 | In file included from ../../arch/x86/include/asm/system.h:7:0,
 |                 from include/kvm/barrier.h:13,
 |                 from builtin-run.c:16:
 | ../../arch/x86/include/asm/cmpxchg.h:11:13: error: no previous prototype for ‘__xchg_wrong_size’ [-Werror=missing-prototypes]
 | ../../arch/x86/include/asm/cmpxchg.h: In function ‘__xchg_wrong_size’:
 | ../../arch/x86/include/asm/cmpxchg.h:12:2: error: expected declaration specifiers before ‘__compiletime_error’

---

Not sure if it's me only or not. I've had no such problems before.

 tools/kvm/include/kvm/compiler.h |    4 ++++
 1 file changed, 4 insertions(+)
tools/kvm/include/kvm/compiler.h +4 -0
Index: linux-2.6.git/tools/kvm/include/kvm/compiler.h
===================================================================
@@ -1,6 +1,10 @@
 #ifndef KVM_COMPILER_H_
 #define KVM_COMPILER_H_
 
+#ifndef __compiletime_error
+# define __compiletime_error(message)
+#endif
+
 #define notrace __attribute__((no_instrument_function))
 
 #endif /* KVM_COMPILER_H_ */