Commit 48125601 authored by Marius Muja's avatar Marius Muja

Fixing ticket #1230

parent 39ec7099
......@@ -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_ */
......@@ -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<Distance>& 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<typename Distance::ElementType>::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");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment