diff --git a/projects/VC7.1/poly2ogr/.gitignore b/projects/VC7.1/poly2ogr/.gitignore
new file mode 100644
index 00000000..0f3a6b1b
--- /dev/null
+++ b/projects/VC7.1/poly2ogr/.gitignore
@@ -0,0 +1,2 @@
+Debug
+Release
diff --git a/projects/VC7.1/poly2ogr/poly2ogr.vcproj b/projects/VC7.1/poly2ogr/poly2ogr.vcproj
new file mode 100644
index 00000000..4f814da8
--- /dev/null
+++ b/projects/VC7.1/poly2ogr/poly2ogr.vcproj
@@ -0,0 +1,140 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/projects/VC7.1/terragear.sln b/projects/VC7.1/terragear.sln
index d5942f1f..3499b09c 100644
--- a/projects/VC7.1/terragear.sln
+++ b/projects/VC7.1/terragear.sln
@@ -227,6 +227,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fgfs-tools-server", "fgfs-t
{22540CD3-D3CA-4C86-A773-80AEEE3ACDED} = {22540CD3-D3CA-4C86-A773-80AEEE3ACDED}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "poly2ogr", "poly2ogr\poly2ogr.vcproj", "{74F5BBD4-D669-4348-8B46-11700135CCF1}"
+ ProjectSection(ProjectDependencies) = postProject
+ {F74722A5-4015-453B-BF4F-161A4766DDA1} = {F74722A5-4015-453B-BF4F-161A4766DDA1}
+ {22540CD3-D3CA-4C86-A773-80AEEE3ACDED} = {22540CD3-D3CA-4C86-A773-80AEEE3ACDED}
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
@@ -393,6 +399,10 @@ Global
{5086D5EB-5EC0-437F-8181-264315F21A17}.Debug.Build.0 = Debug|Win32
{5086D5EB-5EC0-437F-8181-264315F21A17}.Release.ActiveCfg = Release|Win32
{5086D5EB-5EC0-437F-8181-264315F21A17}.Release.Build.0 = Release|Win32
+ {74F5BBD4-D669-4348-8B46-11700135CCF1}.Debug.ActiveCfg = Debug|Win32
+ {74F5BBD4-D669-4348-8B46-11700135CCF1}.Debug.Build.0 = Debug|Win32
+ {74F5BBD4-D669-4348-8B46-11700135CCF1}.Release.ActiveCfg = Release|Win32
+ {74F5BBD4-D669-4348-8B46-11700135CCF1}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
diff --git a/src/Utils/poly2ogr/Makefile.am b/src/Utils/poly2ogr/Makefile.am
index c305528c..6591c7af 100644
--- a/src/Utils/poly2ogr/Makefile.am
+++ b/src/Utils/poly2ogr/Makefile.am
@@ -7,6 +7,6 @@ poly2ogr_CXXFLAGS=$(GDAL_CFLAGS)
poly2ogr_LDADD = \
$(GDAL_LIBS) \
$(top_builddir)/src/Lib/Polygon/libPolygon.a \
- -lsgstructure -lsgmisc -lsgdebug -lz
+ -lsgstructure -lsgmisc -lsgdebug -lz -lplibul
INCLUDES = -I$(top_srcdir)/src/Lib
diff --git a/src/Utils/poly2ogr/poly2ogr.cxx b/src/Utils/poly2ogr/poly2ogr.cxx
index 9c40a871..0432b067 100644
--- a/src/Utils/poly2ogr/poly2ogr.cxx
+++ b/src/Utils/poly2ogr/poly2ogr.cxx
@@ -27,9 +27,13 @@
#include
#include
-#include
-#include
-#include
+#ifdef _MSC_VER
+# define S_ISDIR(a) ((a)&_S_IFDIR)
+# include
+#else
+# include
+# include
+#endif
#include
#include
@@ -264,17 +268,17 @@ void process_file(const std::string& path) {
}
if (S_ISDIR(sbuf.st_mode)) {
- DIR* dir;
+ ulDir* dir;
- dir=opendir(path.c_str());
+ dir=ulOpenDir(path.c_str());
if (!dir) {
SG_LOG(SG_GENERAL, SG_ALERT, "Unable to open directory '" << path << "'");
return;
}
- struct dirent *de;
+ struct ulDirEnt *de;
- while ((de=readdir(dir))) {
+ while ((de=ulReadDir(dir))) {
if (!strcmp(de->d_name,".") || !strcmp(de->d_name,"..")) {
continue;
}
@@ -283,7 +287,7 @@ void process_file(const std::string& path) {
process_file(subpath);
}
- closedir(dir);
+ ulCloseDir(dir);
} else if (endswith(path,".pts")) {
// This is a points file
process_points_file(path);