From b5ef69daf12844e475918acf7e6a7fbe2ccb30b2 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 10 May 2014 10:54:30 +0800 Subject: [PATCH] Modules/UDI - Add check for UDI_VERSION to udi.h --- KernelLand/Modules/Interfaces/UDI/Makefile | 2 +- UDI/include/udi.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/KernelLand/Modules/Interfaces/UDI/Makefile b/KernelLand/Modules/Interfaces/UDI/Makefile index 3b1387be..d149bff3 100644 --- a/KernelLand/Modules/Interfaces/UDI/Makefile +++ b/KernelLand/Modules/Interfaces/UDI/Makefile @@ -1,7 +1,7 @@ # # -CPPFLAGS = -I../../../../UDI/include -Iinclude +CPPFLAGS = -I../../../../UDI/include -Iinclude -D UDI_VERSION=0x101 # - UDI Library Files LIB_OBJS := core/logging.o core/strmem.o core/imc.o core/mem.o core/buf.o diff --git a/UDI/include/udi.h b/UDI/include/udi.h index 50c7077a..76dac7ba 100644 --- a/UDI/include/udi.h +++ b/UDI/include/udi.h @@ -4,6 +4,16 @@ #ifndef _UDI_H_ #define _UDI_H_ +#ifndef UDI_VERSION +# error "Please define UDI_VERSION before including" +#endif +#if UDI_VERSION < 0x100 +# error "Requesting an unsupported UDI version (pre 1.0)" +#endif +#if UDI_VERSION > 0x101 +# error "Requesting an unsupported UDI version (post 1.01)" +#endif + #include #include -- 2.20.1