Skip to content

Commit c1f27e9

Browse files
committed
Fixed some mingw-w64 compilation issues
1 parent 88a72a0 commit c1f27e9

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

modules/datasets/src/util.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
#include <sstream>
4747

48-
#ifdef __GNUC__
48+
#ifndef _WIN32
4949
#include <unistd.h>
5050
#include <dirent.h>
5151
#include <sys/stat.h>
@@ -73,7 +73,7 @@ void split(const string &s, vector<string> &elems, char delim)
7373

7474
void createDirectory(const string &path)
7575
{
76-
#ifdef __GNUC__
76+
#ifndef _WIN32
7777
mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
7878
#else
7979
mkdir(path.c_str());
@@ -82,7 +82,7 @@ void createDirectory(const string &path)
8282

8383
void getDirList(const string &dirName, vector<string> &fileNames)
8484
{
85-
#ifdef __GNUC__
85+
#ifndef _WIN32
8686
struct dirent **namelist;
8787
int n = scandir(dirName.c_str(), &namelist, NULL, alphasort);
8888
for (int i=0; i<n; ++i)

modules/line_descriptor/src/bitarray.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#ifndef __OPENCV_BITARRAY_HPP
4444
#define __OPENCV_BITARRAY_HPP
4545

46-
#ifdef _WIN32
46+
#ifdef _MSC_VER
4747
#pragma warning( disable : 4267 )
4848
#endif
4949

modules/line_descriptor/src/bitops.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
#include "precomp.hpp"
4747

48-
#ifdef _WIN32
48+
#ifdef _MSC_VER
4949
# include <intrin.h>
5050
# define popcnt __popcnt
5151
# pragma warning( disable : 4267 )

modules/line_descriptor/src/precomp.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#ifndef __OPENCV_PRECOMP_H__
4343
#define __OPENCV_PRECOMP_H__
4444

45-
#ifdef _WIN32
45+
#ifdef _MSC_VER
4646
#pragma warning( disable : 4267 )
4747
#endif
4848

modules/line_descriptor/src/types.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
#ifndef __OPENCV_TYPES_HPP
5050
#define __OPENCV_TYPES_HPP
5151

52-
#ifdef _WIN32
52+
#ifdef _MSC_VER
5353
#pragma warning( disable : 4267 )
5454
#endif
5555

modules/surface_matching/src/icp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,14 +425,14 @@ int ICP::registerModelToScene(const Mat& srcPC, const Mat& dstPC, double& residu
425425
if (node)
426426
{
427427
// select the first node
428-
long idx = reinterpret_cast<long>(node->data)-1, dn=0;
428+
size_t idx = reinterpret_cast<size_t>(node->data)-1, dn=0;
429429
int dup = (int)node->key-1;
430-
long minIdxD = idx;
430+
size_t minIdxD = idx;
431431
float minDist = distances[idx];
432432

433433
while ( node )
434434
{
435-
idx = reinterpret_cast<long>(node->data)-1;
435+
idx = reinterpret_cast<size_t>(node->data)-1;
436436

437437
if (distances[idx] < minDist)
438438
{

0 commit comments

Comments
 (0)