aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2014-10-19 14:40:13 +0200
committerShauren <shauren.trinity@gmail.com>2014-10-19 14:40:13 +0200
commit035bda05adc12245e5c59d554c30092efdb64460 (patch)
tree6286dda4f615e9b74bfd59a49c5bd255e91325b8 /src
parente2c2bce90f1713136c2a256e423e5d136dab2389 (diff)
Tools/Extractors: Build fixes for linux
Diffstat (limited to 'src')
-rw-r--r--src/tools/map_extractor/loadlib/loadlib.h20
-rw-r--r--src/tools/mmaps_generator/TerrainBuilder.cpp2
-rw-r--r--src/tools/vmap4_extractor/mpqfile.h25
3 files changed, 11 insertions, 36 deletions
diff --git a/src/tools/map_extractor/loadlib/loadlib.h b/src/tools/map_extractor/loadlib/loadlib.h
index 10d14aed114..3110ad569ea 100644
--- a/src/tools/map_extractor/loadlib/loadlib.h
+++ b/src/tools/map_extractor/loadlib/loadlib.h
@@ -21,24 +21,9 @@
#include "CascLib.h"
#include <map>
+#include <cstdint>
#include <string>
-#ifdef _WIN32
-typedef __int64 int64;
-typedef __int32 int32;
-typedef __int16 int16;
-typedef __int8 int8;
-typedef unsigned __int64 uint64;
-typedef unsigned __int32 uint32;
-typedef unsigned __int16 uint16;
-typedef unsigned __int8 uint8;
-#else
-#include <stdint.h>
-#ifndef uint64_t
-#ifdef __linux__
-#include <linux/types.h>
-#endif
-#endif
typedef int64_t int64;
typedef int32_t int32;
typedef int16_t int16;
@@ -47,6 +32,9 @@ typedef uint64_t uint64;
typedef uint32_t uint32;
typedef uint16_t uint16;
typedef uint8_t uint8;
+
+#ifndef _WIN32
+int GetLastError();
#endif
#define FILE_FORMAT_VERSION 18
diff --git a/src/tools/mmaps_generator/TerrainBuilder.cpp b/src/tools/mmaps_generator/TerrainBuilder.cpp
index 0a3237b4fe5..88b8555b488 100644
--- a/src/tools/mmaps_generator/TerrainBuilder.cpp
+++ b/src/tools/mmaps_generator/TerrainBuilder.cpp
@@ -609,7 +609,7 @@ namespace MMAP
int holeRow = row % 8;
int holeCol = (square - (row * 128 + cellCol * 8));
- return holes[cellRow][cellCol][holeRow] & (1 << holeCol);
+ return (holes[cellRow][cellCol][holeRow] & (1 << holeCol)) != 0;
}
/**************************************************************************/
diff --git a/src/tools/vmap4_extractor/mpqfile.h b/src/tools/vmap4_extractor/mpqfile.h
index 12b666f7c5d..4a283e1dd96 100644
--- a/src/tools/vmap4_extractor/mpqfile.h
+++ b/src/tools/vmap4_extractor/mpqfile.h
@@ -11,25 +11,9 @@
#include <vector>
#include <iostream>
#include <deque>
+#include <cstdint>
#include "CascLib.h"
-#ifdef _WIN32
-#include <Windows.h> // mainly only HANDLE definition is required
-typedef __int64 int64;
-typedef __int32 int32;
-typedef __int16 int16;
-typedef __int8 int8;
-typedef unsigned __int64 uint64;
-typedef unsigned __int32 uint32;
-typedef unsigned __int16 uint16;
-typedef unsigned __int8 uint8;
-#else
-#include <stdint.h>
-#ifndef uint64_t
-#ifdef __linux__
-#include <linux/types.h>
-#endif
-#endif
typedef int64_t int64;
typedef int32_t int32;
typedef int16_t int16;
@@ -38,9 +22,12 @@ typedef uint64_t uint64;
typedef uint32_t uint32;
typedef uint16_t uint16;
typedef uint8_t uint8;
-#endif
-using namespace std;
+#ifdef _WIN32
+#include <Windows.h> // mainly only HANDLE definition is required
+#else
+int GetLastError();
+#endif
class MPQFile
{