| @@ -68,21 +68,8 @@ dnl Activate some header-only libraries | |||||
| dnl | dnl | ||||
| LOL_CFLAGS="$LOL_CFLAGS -I\$(lol_srcdir)/src/3rdparty/cpp-httplib" | LOL_CFLAGS="$LOL_CFLAGS -I\$(lol_srcdir)/src/3rdparty/cpp-httplib" | ||||
| LOL_CFLAGS="$LOL_CFLAGS -I\$(lol_srcdir)/src/3rdparty/pegtl/include" | |||||
| LOL_CFLAGS="$LOL_CFLAGS -I\$(lol_srcdir)/src/3rdparty/imgui" | LOL_CFLAGS="$LOL_CFLAGS -I\$(lol_srcdir)/src/3rdparty/imgui" | ||||
| dnl Use system-provided getopt_long? | |||||
| ac_cv_have_getopt_long="no" | |||||
| AC_CHECK_HEADERS(getopt.h unistd.h) | |||||
| AC_CHECK_FUNCS(getopt_long, | |||||
| [ac_cv_have_getopt_long="yes"], | |||||
| [AC_CHECK_LIB(gnugetopt, getopt_long, | |||||
| [ac_cv_have_getopt_long="yes" | |||||
| LIBS="${LIBS} -lgnugetopt"])]) | |||||
| if test "$ac_cv_have_getopt_long" != "no"; then | |||||
| AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the ‘getopt_long’ function.) | |||||
| fi | |||||
| dnl Use OpenSSL? | dnl Use OpenSSL? | ||||
| ac_cv_have_openssl=no | ac_cv_have_openssl=no | ||||
| @@ -8,10 +8,6 @@ | |||||
| <PlatformCode Condition="'$(Platform)'=='Win32'">i686</PlatformCode> | <PlatformCode Condition="'$(Platform)'=='Win32'">i686</PlatformCode> | ||||
| <PlatformCode Condition="'$(Platform)'=='x64'">x86_64</PlatformCode> | <PlatformCode Condition="'$(Platform)'=='x64'">x86_64</PlatformCode> | ||||
| <!-- PEGTL --> | |||||
| <PegtlDir>$(LolDir)\src/3rdparty\pegtl\include</PegtlDir> | |||||
| <PegtlIncludes>$(PegtlDir)</PegtlIncludes> | |||||
| <!-- imgui --> | <!-- imgui --> | ||||
| <ImguiDir>$(LolDir)\src\3rdparty\imgui</ImguiDir> | <ImguiDir>$(LolDir)\src\3rdparty\imgui</ImguiDir> | ||||
| <ImguiIncludes>$(ImguiDir)</ImguiIncludes> | <ImguiIncludes>$(ImguiDir)</ImguiIncludes> | ||||
| @@ -1 +1 @@ | |||||
| Subproject commit d21392096ab6dcef67c105c660e2d9ed23c7c075 | |||||
| Subproject commit c806e7728016d3538fbc4806b992188888815f48 | |||||
| @@ -33,46 +33,11 @@ | |||||
| namespace lol | namespace lol | ||||
| { | { | ||||
| /* | |||||
| * Public log class | |||||
| */ | |||||
| void msg::debug(char const *fmt, ...) | |||||
| { | |||||
| va_list ap; | |||||
| va_start(ap, fmt); | |||||
| helper(message_type::debug, fmt, ap); | |||||
| va_end(ap); | |||||
| } | |||||
| void msg::info(char const *fmt, ...) | |||||
| { | |||||
| va_list ap; | |||||
| va_start(ap, fmt); | |||||
| helper(message_type::info, fmt, ap); | |||||
| va_end(ap); | |||||
| } | |||||
| void msg::warn(char const *fmt, ...) | |||||
| { | |||||
| va_list ap; | |||||
| va_start(ap, fmt); | |||||
| helper(message_type::warning, fmt, ap); | |||||
| va_end(ap); | |||||
| } | |||||
| void msg::error(char const *fmt, ...) | |||||
| { | |||||
| va_list ap; | |||||
| va_start(ap, fmt); | |||||
| helper(message_type::error, fmt, ap); | |||||
| va_end(ap); | |||||
| } | |||||
| /* | /* | ||||
| * Private helper function | * Private helper function | ||||
| */ | */ | ||||
| #if 0 | |||||
| void msg::helper(message_type type, char const *fmt, va_list ap) | void msg::helper(message_type type, char const *fmt, va_list ap) | ||||
| { | { | ||||
| /* Unless this is a debug build, ignore debug messages unless | /* Unless this is a debug build, ignore debug messages unless | ||||
| @@ -126,6 +91,7 @@ void msg::helper(message_type type, char const *fmt, va_list ap) | |||||
| # endif | # endif | ||||
| #endif | #endif | ||||
| } | } | ||||
| #endif | |||||
| } /* namespace lol */ | } /* namespace lol */ | ||||
| @@ -13,9 +13,9 @@ | |||||
| #pragma once | #pragma once | ||||
| #include <lol/utils> | #include <lol/utils> | ||||
| #include <lol/msg> | |||||
| #include <../legacy/lol/base/types.h> | #include <../legacy/lol/base/types.h> | ||||
| #include <lol/base/log.h> | |||||
| #include <../legacy/lol/base/assert.h> | #include <../legacy/lol/base/assert.h> | ||||
| #include <../legacy/lol/base/avl_tree.h> | #include <../legacy/lol/base/avl_tree.h> | ||||
| #include <lol/base/enum.h> | #include <lol/base/enum.h> | ||||
| @@ -1,48 +0,0 @@ | |||||
| // | |||||
| // Lol Engine | |||||
| // | |||||
| // Copyright © 2010—2020 Sam Hocevar <sam@hocevar.net> | |||||
| // | |||||
| // Lol Engine 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 | |||||
| // | |||||
| // The msg interface | |||||
| // ----------------- | |||||
| // The central logging system. | |||||
| // | |||||
| #include <lol/utils> // lol_attr_printf_format | |||||
| #include <cstdarg> // va_list | |||||
| namespace lol | |||||
| { | |||||
| class msg | |||||
| { | |||||
| public: | |||||
| static void debug(char const *format, ...) lol_attr_printf_format(1, 2); | |||||
| static void info(char const *format, ...) lol_attr_printf_format(1, 2); | |||||
| static void warn(char const *format, ...) lol_attr_printf_format(1, 2); | |||||
| static void error(char const *format, ...) lol_attr_printf_format(1, 2); | |||||
| enum class message_type | |||||
| { | |||||
| debug, | |||||
| info, | |||||
| warning, | |||||
| error, | |||||
| }; | |||||
| private: | |||||
| static void helper(message_type type, char const *fmt, va_list ap); | |||||
| }; | |||||
| } /* namespace lol */ | |||||