Skip to content

Commit 1138f8a

Browse files
authored
Merge pull request #25 from joa-quim/master
Changes for bulding with Visual Sudio
2 parents 4d8b92c + 5bb011b commit 1138f8a

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

src/coastline_ring_collection.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
#include "output_database.hpp"
3030
#include "srs.hpp"
3131

32+
#ifdef _MSC_VER
33+
#include <io.h>
34+
#include <BaseTsd.h>
35+
typedef SSIZE_T ssize_t;
36+
#endif
37+
3238
extern SRS srs;
3339
extern bool debug;
3440

@@ -263,7 +269,11 @@ unsigned int CoastlineRingCollection::check_for_intersections(OutputDatabase& ou
263269
if (segments_fd >= 0) {
264270
if (debug) std::cerr << "Writing segments to file...\n";
265271
ssize_t length = segments.size() * sizeof(osmium::UndirectedSegment);
272+
#ifndef _MSC_VER
266273
if (::write(segments_fd, segments.data(), length) != length) {
274+
#else
275+
if (_write(segments_fd, segments.data(), length) != length) {
276+
#endif
267277
throw std::runtime_error{"Write error"};
268278
}
269279
}

src/options.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
#include "return_codes.hpp"
2929
#include "options.hpp"
3030

31+
#ifdef _MSC_VER
32+
#define strcasecmp _stricmp
33+
#endif
34+
3135
Options::Options(int argc, char* argv[]) :
3236
inputfile(),
3337
bbox_overlap(-1),

src/osmcoastline.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
# include <unistd.h>
3636
#else
3737
# include <io.h>
38-
# include <windows.h>
3938
#endif
4039

4140
#include <ogr_core.h>

src/osmcoastline_segments.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
# include <unistd.h>
3939
#else
4040
# include <io.h>
41-
# include <windows.h>
4241
#endif
4342

4443
#include <osmium/osm/undirected_segment.hpp>

0 commit comments

Comments
 (0)