Fixed compilation with latest mingw64
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -7,3 +7,6 @@
|
||||
[submodule "docs/wiki"]
|
||||
path = docs/wiki
|
||||
url = https://github.com/WagicProject/wagic.wiki
|
||||
[submodule "thirdparty/curl"]
|
||||
path = thirdparty/curl
|
||||
url = https://github.com/curl/curl.git
|
||||
|
||||
@@ -42,9 +42,9 @@ private:
|
||||
// convert the socket into non-blocking state
|
||||
bool SetNonBlocking(int sock);
|
||||
// socket handle
|
||||
#ifdef WIN32
|
||||
#if (defined WIN32) && (!defined __GNUG__)
|
||||
SOCKET mfd;
|
||||
#elif LINUX || PSP
|
||||
#elif LINUX || PSP || __GNUG__
|
||||
int mfd;
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -112,6 +112,7 @@ enum {
|
||||
#endif // CONSOLE_CONFIG
|
||||
|
||||
#if (defined WIN32) && (!defined LINUX)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#if defined(LINUX) && (!defined WIN32) || defined(IOS) || defined (ANDROID)
|
||||
|
||||
@@ -42,7 +42,7 @@ bool JNetwork::isConnected(){
|
||||
|
||||
void JNetwork::getServerIp(string& aString)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#if (defined WIN32) && (!defined __GNUG__)
|
||||
char ac[80];
|
||||
if (gethostname(ac, sizeof(ac)) == SOCKET_ERROR) {
|
||||
DebugTrace("Error " << WSAGetLastError() <<
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "../include/JLBFont.h"
|
||||
#include "tinyxml.h"
|
||||
|
||||
#if defined (_DEBUG) && defined (WIN32) && (!defined LINUX)
|
||||
#if defined (_DEBUG) && defined (WIN32) && (!defined LINUX) && (!defined __GNUG__)
|
||||
#include "crtdbg.h"
|
||||
#define NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
|
||||
#else
|
||||
|
||||
@@ -35,7 +35,7 @@ extern "C" {
|
||||
#include "../../include/JFileSystem.h"
|
||||
#include "../../include/JAssert.h"
|
||||
|
||||
#if (defined WIN32) && (!defined QT_CONFIG)
|
||||
#if (defined WIN32) && (!defined QT_CONFIG) && (!defined SDL_CONFIG)
|
||||
#ifndef __attribute__
|
||||
#define __attribute__((a))
|
||||
#endif
|
||||
@@ -1665,7 +1665,7 @@ static void jpeg_mem_src(j_decompress_ptr cinfo, byte *mem, int len)
|
||||
cinfo->src->resync_to_restart = jpeg_resync_to_restart;
|
||||
cinfo->src->term_source = jpg_null;
|
||||
cinfo->src->bytes_in_buffer = len;
|
||||
cinfo->src->next_input_byte = mem;
|
||||
cinfo->src->next_input_byte = (const JOCTET*)mem;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1702,7 +1702,7 @@ void JRenderer::LoadJPG(TextureInfo &textureInfo, const char *filename, int mode
|
||||
cinfo.err = jpeg_std_error(&jerr);
|
||||
jpeg_create_decompress(&cinfo);
|
||||
|
||||
jpeg_mem_src(&cinfo, rawdata, rawsize);
|
||||
jpeg_mem_src(&cinfo, (byte*)rawdata, rawsize);
|
||||
|
||||
// Process JPEG header
|
||||
jpeg_read_header(&cinfo, true);
|
||||
@@ -1740,7 +1740,7 @@ void JRenderer::LoadJPG(TextureInfo &textureInfo, const char *filename, int mode
|
||||
// Pass sizes to output
|
||||
|
||||
// Allocate Scanline buffer
|
||||
scanline = (byte *)malloc(cinfo.output_width * 3);
|
||||
scanline = (BYTE *)malloc(cinfo.output_width * 3);
|
||||
if(!scanline)
|
||||
{
|
||||
//// ri.Con_Printf(PRINT_ALL, "Insufficient RAM for JPEG scanline buffer\n");
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "limits.h"
|
||||
|
||||
#if defined (_DEBUG) && defined (WIN32) && (!defined LINUX)
|
||||
#if defined (_DEBUG) && defined (WIN32) && (!defined LINUX) && (!defined __GNUG__)
|
||||
#include "crtdbg.h"
|
||||
#define NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
|
||||
#else
|
||||
|
||||
@@ -91,7 +91,7 @@ void GameApp::Create()
|
||||
{
|
||||
srand((unsigned int) time(0)); // initialize random
|
||||
#if !defined(QT_CONFIG) && !defined(IOS)
|
||||
#if defined (WIN32)
|
||||
#if defined (WIN32) && (!defined __GNUG__)
|
||||
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
|
||||
#elif defined (PSP)
|
||||
pspFpuSetEnable(0); //disable FPU Exceptions until we find where the FPU errors come from
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include "ModRules.h"
|
||||
#include "GameApp.h"
|
||||
|
||||
#include <random>
|
||||
|
||||
#ifdef TESTSUITE
|
||||
#include "TestSuiteAI.h"
|
||||
#endif
|
||||
@@ -2258,7 +2260,10 @@ std::string Tournament::exportTournamentDescription()
|
||||
}
|
||||
|
||||
void Tournament::enableTournamantMode(int tournamentMode,int player)
|
||||
{
|
||||
{
|
||||
std::random_device rd;
|
||||
std::mt19937 g(rd());
|
||||
|
||||
if (mTournamentMode!=tournamentMode && tournamentMode>0)
|
||||
{
|
||||
|
||||
@@ -2302,9 +2307,9 @@ void Tournament::enableTournamantMode(int tournamentMode,int player)
|
||||
//shuffle remaining decks
|
||||
// human player is always on first place
|
||||
if (player>0)
|
||||
std::random_shuffle ( TournamentsDecks.begin()+1, TournamentsDecks.end() );
|
||||
std::shuffle ( TournamentsDecks.begin()+1, TournamentsDecks.end(), g );
|
||||
else
|
||||
std::random_shuffle ( TournamentsDecks.begin(), TournamentsDecks.end() );
|
||||
std::shuffle ( TournamentsDecks.begin(), TournamentsDecks.end(), g );
|
||||
Deck[0]=TournamentsDecks[0];
|
||||
Deck[1]=TournamentsDecks[1];
|
||||
}
|
||||
@@ -2322,7 +2327,7 @@ void Tournament::enableTournamantMode(int tournamentMode,int player)
|
||||
for (unsigned int i=0;i<nmbDecks;i++)
|
||||
TournamentsDecks.push_back(TDeck(i+1,PLAYER_TYPE_CPU));
|
||||
//shuffle remaining decks
|
||||
std::random_shuffle ( TournamentsDecks.begin(), TournamentsDecks.end() );
|
||||
std::shuffle ( TournamentsDecks.begin(), TournamentsDecks.end(), g );
|
||||
Deck[0]=TournamentsDecks[0];
|
||||
Deck[1]=TournamentsDecks[1];
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "DeckDataWrapper.h"
|
||||
#include "MTGPack.h"
|
||||
#include "tinyxml.h"
|
||||
#include <random>
|
||||
|
||||
MTGPack MTGPacks::defaultBooster;
|
||||
|
||||
@@ -47,9 +48,13 @@ int MTGPackSlot::add(WSrcCards * ocean, MTGDeck *to, int carryover)
|
||||
if (!myPool)
|
||||
myPool = ocean;
|
||||
|
||||
std::random_device rd;
|
||||
std::mt19937 g(rd());
|
||||
|
||||
for (int i = 0; i < amt; i++)
|
||||
{
|
||||
std::random_shuffle(entries.begin(), entries.end());
|
||||
//std::random_shuffle(entries.begin(), entries.end());
|
||||
std::shuffle(entries.begin(), entries.end(), g);
|
||||
size_t pos = 0;
|
||||
while (pos < entries.size() && entries[pos]->addCard(myPool, to))
|
||||
pos++;
|
||||
|
||||
1
thirdparty/curl
vendored
Submodule
1
thirdparty/curl
vendored
Submodule
Submodule thirdparty/curl added at 3394644325
Reference in New Issue
Block a user