Skip to content

Commit 8875bb4

Browse files
authored
Make IBIze build on modern Linux and Mac OS systems (#5)
* Set correct subdirectory in CMakeLists.txt Paths are case sensitive on Linux and Mac OS system, so specify the correct subdirectory. * Use C++11 standard for CMake Use the C++11 standard when building with CMake, as e.g. C++17 introduced std::byte which is a conflicting type with the one declared in Ibize. * ibize: Add missing includes Add any missing includes for Ibize to compile with a modern version of GCC, in particular using the standard C++11 or newer. Also use C++ like include headers instead of C style ones.
1 parent 73ceb95 commit 8875bb4

File tree

6 files changed

+14
-6
lines changed

6 files changed

+14
-6
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
cmake_minimum_required(VERSION 3.1)
22
project(OpenJK-Tools)
33

4-
add_subdirectory(Ibize)
4+
set(CMAKE_CXX_STANDARD 11)
5+
6+
add_subdirectory(ibize)

ibize/blockstream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#pragma warning(disable : 4100) //unref formal parm
66
#pragma warning(disable : 4710) //member not inlined
77

8-
#include <string.h>
8+
#include <cstring>
99
#include "blockstream.h"
1010

1111
/*

ibize/blockstream.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55

66
#pragma warning(disable : 4786) //identifier was truncated
77

8-
#include <stdio.h>
9-
8+
#include <cstdint>
9+
#include <cstdio>
10+
#include <cstdlib>
1011
#include <list>
1112
#include <vector>
13+
1214
using namespace std;
1315

1416
#define IBI_EXT ".IBI" //(I)nterpreted (B)lock (I)nstructions

ibize/ibize_platform.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
#if defined(_WINDOWS)
66
#include <windows.h>
77
#else
8-
#include <stdint.h>
8+
#include <cstdint>
9+
#include <cstring>
10+
#include <cstddef>
911
typedef uint32_t COLORREF;
1012
#define stricmp strcasecmp
1113
#define RGB(r,g,b) ((COLORREF)((r) | ((g) << 8) | ((b) << 16)))

ibize/interpreter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
#else
99
#include <unistd.h>
1010
#endif
11-
#include <stdio.h>
11+
#include <cstdarg>
12+
#include <cstdio>
1213

1314
#include "tokenizer.h"
1415
#include "blockstream.h"

ibize/tokenizer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <vector>
1111
#include <map>
1212
#include <cstdint>
13+
#include <cstring>
1314

1415
using namespace std;
1516

0 commit comments

Comments
 (0)