Bladeren bron

Update lol-core submodule and apply a few related fixes.

legacy
Sam Hocevar 4 jaren geleden
bovenliggende
commit
99a360f93d
6 gewijzigde bestanden met toevoegingen van 4 en 103 verwijderingen
  1. +0
    -13
      build/autotools/m4/lol-conf.m4
  2. +0
    -4
      build/msbuild/lol.vars.props
  3. +1
    -1
      lol-core
  4. +2
    -36
      src/base/log.cpp
  5. +1
    -1
      src/lol/base/all.h
  6. +0
    -48
      src/lol/base/log.h

+ 0
- 13
build/autotools/m4/lol-conf.m4 Bestand weergeven

@@ -68,21 +68,8 @@ dnl Activate some header-only libraries
dnl

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"

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?
ac_cv_have_openssl=no


+ 0
- 4
build/msbuild/lol.vars.props Bestand weergeven

@@ -8,10 +8,6 @@
<PlatformCode Condition="'$(Platform)'=='Win32'">i686</PlatformCode>
<PlatformCode Condition="'$(Platform)'=='x64'">x86_64</PlatformCode>

<!-- PEGTL -->
<PegtlDir>$(LolDir)\src/3rdparty\pegtl\include</PegtlDir>
<PegtlIncludes>$(PegtlDir)</PegtlIncludes>

<!-- imgui -->
<ImguiDir>$(LolDir)\src\3rdparty\imgui</ImguiDir>
<ImguiIncludes>$(ImguiDir)</ImguiIncludes>


+ 1
- 1
lol-core

@@ -1 +1 @@
Subproject commit d21392096ab6dcef67c105c660e2d9ed23c7c075
Subproject commit c806e7728016d3538fbc4806b992188888815f48

+ 2
- 36
src/base/log.cpp Bestand weergeven

@@ -33,46 +33,11 @@
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
*/

#if 0
void msg::helper(message_type type, char const *fmt, va_list ap)
{
/* 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

} /* namespace lol */


+ 1
- 1
src/lol/base/all.h Bestand weergeven

@@ -13,9 +13,9 @@
#pragma once

#include <lol/utils>
#include <lol/msg>

#include <../legacy/lol/base/types.h>
#include <lol/base/log.h>
#include <../legacy/lol/base/assert.h>
#include <../legacy/lol/base/avl_tree.h>
#include <lol/base/enum.h>


+ 0
- 48
src/lol/base/log.h Bestand weergeven

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


Laden…
Annuleren
Opslaan