Add mingw-std-threads project to external/ for full C++11 thread support, fix an incorrect Win32 fix I did in PEGTL, work around mingw’s <io.h> declaring a conflicting eof symbol, and fix a capitalisation error in log.cpp.undefined
@@ -287,6 +287,12 @@ LOL_CHECK_OPENGL | |||||
LOL_CHECK_SDL | LOL_CHECK_SDL | ||||
dnl Use mingw threads if necessary | |||||
if true; then | |||||
LOL_CFLAGS="$LOL_CFLAGS -I\$(top_srcdir)/external/mingw-std-threads-0.0.ac5c9e3b/include/" | |||||
fi | |||||
dnl Use pegtl? Yes, always | dnl Use pegtl? Yes, always | ||||
if true; then | if true; then | ||||
LOL_CFLAGS="$LOL_CFLAGS -I\$(top_srcdir)/external/pegtl-0.32/include" | LOL_CFLAGS="$LOL_CFLAGS -I\$(top_srcdir)/external/pegtl-0.32/include" | ||||
@@ -1,12 +1,13 @@ | |||||
// | // | ||||
// Lol Engine | // Lol Engine | ||||
// | // | ||||
// Copyright: © 2010—2015 Sam Hocevar <sam@hocevar.net> | |||||
// Copyright © 2010—2015 Sam Hocevar <sam@hocevar.net> | |||||
// | // | ||||
// This library is free software; you can redistribute it and/or | |||||
// modify it under the terms of the Do What The Fuck You Want To | |||||
// Public License, Version 2, as published by Sam Hocevar. See | |||||
// http://www.wtfpl.net/ for more details. | |||||
// This library is free software. It comes without any warranty, to | |||||
// the extent permitted by applicable law. You can redistribute it | |||||
// and/or modify it under the terms of the Do What the Fuck You Want | |||||
// to Public License, Version 2, as published by the WTFPL Task Force. | |||||
// See http://www.wtfpl.net/ for more details. | |||||
// | // | ||||
#include <lol/engine-internal.h> | #include <lol/engine-internal.h> | ||||
@@ -95,7 +96,7 @@ void msg::helper(MessageType type, char const *fmt, va_list ap) | |||||
String buf = String(prefix[(int)type]) + ": " + String::vformat(fmt, ap); | String buf = String(prefix[(int)type]) + ": " + String::vformat(fmt, ap); | ||||
array<WCHAR> widechar; | array<WCHAR> widechar; | ||||
widechar.Resize(buf.count() + 1); | |||||
widechar.resize(buf.count() + 1); | |||||
MultiByteToWideChar(CP_UTF8, 0, buf.C(), buf.count() + 1, widechar.data(), widechar.count()); | MultiByteToWideChar(CP_UTF8, 0, buf.C(), buf.count() + 1, widechar.data(), widechar.count()); | ||||
OutputDebugStringW(widechar.data()); | OutputDebugStringW(widechar.data()); | ||||
# else | # else | ||||
@@ -174,7 +174,7 @@ private: | |||||
// code_section < code_line{&(title / eof)} | // code_section < code_line{&(title / eof)} | ||||
struct code_section | struct code_section | ||||
: ifapply<until<at<sor<title_ignore, eof>>, code_line>, do_code> {}; | |||||
: ifapply<until<at<sor<title_ignore, pegtl::eof>>, code_line>, do_code> {}; | |||||
// shader < title code_section | // shader < title code_section | ||||
struct shader | struct shader | ||||
@@ -1,22 +1,24 @@ | |||||
// | // | ||||
// Lol Engine | |||||
// Lol Engine | |||||
// | // | ||||
// Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net> | |||||
// This program is free software; you can redistribute it and/or | |||||
// modify it under the terms of the Do What The Fuck You Want To | |||||
// Public License, Version 2, as published by Sam Hocevar. See | |||||
// http://www.wtfpl.net/ for more details. | |||||
// Copyright © 2010—2013 Sam Hocevar <sam@hocevar.net> | |||||
// | |||||
// This library is free software. It comes without any warranty, to | |||||
// the extent permitted by applicable law. You can redistribute it | |||||
// and/or modify it under the terms of the Do What the Fuck You Want | |||||
// to Public License, Version 2, as published by the WTFPL Task Force. | |||||
// See http://www.wtfpl.net/ for more details. | |||||
// | // | ||||
#pragma once | #pragma once | ||||
#include <lol/base/avl_tree.h> | |||||
#include <lol/base/features.h> | #include <lol/base/features.h> | ||||
#include <lol/base/types.h> | #include <lol/base/types.h> | ||||
#include <lol/base/log.h> | #include <lol/base/log.h> | ||||
#include <lol/base/assert.h> | #include <lol/base/assert.h> | ||||
#include <lol/base/tuple.h> | #include <lol/base/tuple.h> | ||||
#include <lol/base/array.h> | #include <lol/base/array.h> | ||||
#include <lol/base/avl_tree.h> | |||||
#include <lol/base/string.h> | #include <lol/base/string.h> | ||||
#include <lol/base/hash.h> | #include <lol/base/hash.h> | ||||
#include <lol/base/map.h> | #include <lol/base/map.h> | ||||
@@ -39,6 +39,15 @@ | |||||
# undef far /* Fuck Microsoft again */ | # undef far /* Fuck Microsoft again */ | ||||
#endif | #endif | ||||
/* XXX: workaround for missing std::thread in mingw */ | |||||
#if _GLIBCXX_MUTEX && !_GLIBCXX_HAS_GTHREADS && _WIN32 | |||||
# include "mingw.thread.h" | |||||
# include "mingw.mutex.h" | |||||
# include "mingw.condition_variable.h" | |||||
# undef near /* Fuck Microsoft */ | |||||
# undef far /* Fuck Microsoft again */ | |||||
#endif | |||||
namespace lol | namespace lol | ||||
{ | { | ||||
@@ -1,5 +1,5 @@ | |||||
// | // | ||||
// LolRemez - Remez algorithm implementation | |||||
// LolRemez — Remez algorithm implementation | |||||
// | // | ||||
// Copyright © 2005—2015 Sam Hocevar <sam@hocevar.net> | // Copyright © 2005—2015 Sam Hocevar <sam@hocevar.net> | ||||
// | // | ||||
@@ -291,7 +291,7 @@ private: | |||||
star<sor<r_add, r_sub>>> {}; | star<sor<r_add, r_sub>>> {}; | ||||
// r_stmt <- r_expr <end> | // r_stmt <- r_expr <end> | ||||
struct r_stmt : seq<_, r_expr, _, eof> {}; | |||||
struct r_stmt : seq<_, r_expr, _, pegtl::eof> {}; | |||||
}; | }; | ||||
} /* namespace grammar */ | } /* namespace grammar */ | ||||