From 481256017e66f6163a142c44f0aa5fb5d8a9980d Mon Sep 17 00:00:00 2001 From: Marius Muja Date: Mon, 18 Jul 2011 21:57:28 +0000 Subject: [PATCH] Fixing ticket #1230 --- modules/flann/include/opencv2/flann/config.h | 5 ++++- modules/flann/include/opencv2/flann/saving.h | 11 +++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/flann/include/opencv2/flann/config.h b/modules/flann/include/opencv2/flann/config.h index ca6138d1e..56832fd37 100644 --- a/modules/flann/include/opencv2/flann/config.h +++ b/modules/flann/include/opencv2/flann/config.h @@ -30,6 +30,9 @@ #ifndef OPENCV_FLANN_CONFIG_H_ #define OPENCV_FLANN_CONFIG_H_ -#define FLANN_VERSION "1.6.10" +#ifdef FLANN_VERSION_ +#undef FLANN_VERSION_ +#endif +#define FLANN_VERSION_ "1.6.10" #endif /* OPENCV_FLANN_CONFIG_H_ */ diff --git a/modules/flann/include/opencv2/flann/saving.h b/modules/flann/include/opencv2/flann/saving.h index 047a1c309..e319b50de 100644 --- a/modules/flann/include/opencv2/flann/saving.h +++ b/modules/flann/include/opencv2/flann/saving.h @@ -35,7 +35,10 @@ #include "general.h" #include "nn_index.h" -#define FLANN_SIGNATURE "FLANN_INDEX" +#ifdef FLANN_SIGNATURE_ +#undef FLANN_SIGNATURE_ +#endif +#define FLANN_SIGNATURE_ "FLANN_INDEX" namespace cvflann { @@ -84,9 +87,9 @@ void save_header(FILE* stream, const NNIndex& index) { IndexHeader header; memset(header.signature, 0, sizeof(header.signature)); - strcpy(header.signature, FLANN_SIGNATURE); + strcpy(header.signature, FLANN_SIGNATURE_); memset(header.version, 0, sizeof(header.version)); - strcpy(header.version, FLANN_VERSION); + strcpy(header.version, FLANN_VERSION_); header.data_type = Datatype::type(); header.index_type = index.getType(); header.rows = index.size(); @@ -110,7 +113,7 @@ inline IndexHeader load_header(FILE* stream) throw FLANNException("Invalid index file, cannot read"); } - if (strcmp(header.signature,FLANN_SIGNATURE)!=0) { + if (strcmp(header.signature,FLANN_SIGNATURE_)!=0) { throw FLANNException("Invalid index file, wrong signature"); }