Mac OS X 10.6 & More C++03 Support (#68)

* Mac OS X 10.6 & More C++03 Support

* Fix SDL2 options.txt loading for C++03

---------

Co-authored-by: Brent Da Mage <BrentDaMage@users.noreply.github.com>
This commit is contained in:
Brent
2023-08-27 03:46:15 -05:00
committed by GitHub
parent 0c38c01c28
commit f7915a1dab
57 changed files with 1736 additions and 1534 deletions

View File

@@ -6,7 +6,7 @@
SPDX-License-Identifier: BSD-1-Clause
********************************************************************/
#include <cstdint>
#include <stdint.h>
#include "CThread.hpp"
#include "common/Utils.hpp"

View File

@@ -7,7 +7,8 @@
********************************************************************/
#include <cmath>
#include <cstdint>
#include <stdint.h>
#include <stdlib.h>
#include "Mth.hpp"

View File

@@ -7,7 +7,6 @@
********************************************************************/
#include "Random.hpp"
#include "common/Utils.hpp"
/* Period parameters */
#define N 624

View File

@@ -8,8 +8,9 @@
#pragma once
#include <cstdint>
#include <stdint.h>
#include "LongHack.hpp"
#include "common/Utils.hpp"
// This appears to be VERY similar to https://github.com/SethRobinson/proton/blob/master/shared/util/CRandom.h#L10
// It turns out, RTsoft, Mojang, and the author of Game Coding Complete used the same reference implementation of

View File

@@ -23,7 +23,7 @@ public:
template<typename T>
static bool remove(std::vector<T>& vec, const T& t)
{
auto iter = std::find(vec.begin(), vec.end(), t);
typename std::vector<T>::iterator iter = std::find(vec.begin(), vec.end(), t);
if (iter == vec.end())
return false;
@@ -36,7 +36,7 @@ public:
{
int removed = 0;
for (auto it = toRemove.begin(); it != toRemove.end(); it++)
for (typename std::vector<T>::const_iterator it = toRemove.begin(); it != toRemove.end(); it++)
{
T rem = *it;

View File

@@ -21,9 +21,12 @@
#endif
#include <string>
#include <sstream>
#ifdef USE_OLD_CPP
#define constexpr const
#define nullptr NULL
#define override
#endif
#if defined(_WIN32)
@@ -579,6 +582,9 @@ struct TilePos : Pos
#define SAFE_DELETE(ptr) do { if (ptr) delete ptr; } while (0)
#define SAFE_DELETE_ARRAY(ptr) do { if (ptr) delete[] ptr; } while (0)
#define SSTR( x ) static_cast< std::ostringstream & >( \
( std::ostringstream() << std::dec << x ) ).str()
typedef uint8_t TileID;
// functions from Mojang