浏览代码

misc: various mingw cross-compilation fixes.

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
Sam Hocevar 9 年前
父节点
当前提交
ccf5f53825
共有 6 个文件被更改,包括 34 次插入16 次删除
  1. +6
    -0
      configure.ac
  2. +7
    -6
      src/base/log.cpp
  3. +1
    -1
      src/gpu/shader.cpp
  4. +9
    -7
      src/lol/base/all.h
  5. +9
    -0
      src/sys/threadbase.h
  6. +2
    -2
      tools/lolremez/expression.h

+ 6
- 0
configure.ac 查看文件

@@ -287,6 +287,12 @@ LOL_CHECK_OPENGL
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
if true; then
LOL_CFLAGS="$LOL_CFLAGS -I\$(top_srcdir)/external/pegtl-0.32/include"


+ 7
- 6
src/base/log.cpp 查看文件

@@ -1,12 +1,13 @@
//
// 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>
@@ -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);

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());
OutputDebugStringW(widechar.data());
# else


+ 1
- 1
src/gpu/shader.cpp 查看文件

@@ -174,7 +174,7 @@ private:

// code_section < code_line{&(title / eof)}
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
struct shader


+ 9
- 7
src/lol/base/all.h 查看文件

@@ -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

#include <lol/base/avl_tree.h>
#include <lol/base/features.h>
#include <lol/base/types.h>
#include <lol/base/log.h>
#include <lol/base/assert.h>
#include <lol/base/tuple.h>
#include <lol/base/array.h>
#include <lol/base/avl_tree.h>
#include <lol/base/string.h>
#include <lol/base/hash.h>
#include <lol/base/map.h>


+ 9
- 0
src/sys/threadbase.h 查看文件

@@ -39,6 +39,15 @@
# undef far /* Fuck Microsoft again */
#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
{



+ 2
- 2
tools/lolremez/expression.h 查看文件

@@ -1,5 +1,5 @@
//
// LolRemez - Remez algorithm implementation
// LolRemez Remez algorithm implementation
//
// Copyright © 2005—2015 Sam Hocevar <sam@hocevar.net>
//
@@ -291,7 +291,7 @@ private:
star<sor<r_add, r_sub>>> {};

// r_stmt <- r_expr <end>
struct r_stmt : seq<_, r_expr, _, eof> {};
struct r_stmt : seq<_, r_expr, _, pegtl::eof> {};
};

} /* namespace grammar */


正在加载...
取消
保存