Przeglądaj źródła

Make more headers private and remove unnecessary #includes.

wip/core-clipp
Sam Hocevar 4 lat temu
rodzic
commit
2626ce4efe
12 zmienionych plików z 39 dodań i 25 usunięć
  1. +0
    -1
      TODO.md
  2. +1
    -0
      include/lol/base/core.h
  3. +0
    -0
      include/lol/base/private/features.h
  4. +8
    -8
      include/lol/base/private/map.h
  5. +3
    -4
      include/lol/base/private/string.h
  6. +1
    -2
      include/lol/base/thread.h
  7. +17
    -0
      include/lol/base/utils.h
  8. +2
    -2
      include/lol/math/polynomial.h
  9. +1
    -1
      include/lol/math/private/matrix.h
  10. +0
    -1
      include/lol/math/private/ops.h
  11. +1
    -1
      include/lol/math/rand.h
  12. +5
    -5
      include/lol/math/real.h

+ 0
- 1
TODO.md Wyświetl plik

@@ -1,7 +1,6 @@

## `lol` headers to keep

src/lol/base/map.h (map utilities)
src/lol/base/types.h (vec_t shortcuts eg. vec2, ivec2, u8vec3 etc.)
src/lol/math/bigint.h
src/lol/math/constants.h


+ 1
- 0
include/lol/base/core.h Wyświetl plik

@@ -12,6 +12,7 @@

#pragma once

#include <string> // std::string
#include <cstdlib> // _dupenv_s / std::getenv

namespace lol


include/lol/base/features.h → include/lol/base/private/features.h Wyświetl plik


legacy/lol/base/map.h → include/lol/base/private/map.h Wyświetl plik

@@ -1,7 +1,7 @@
//
// Lol Engine
//
// Copyright © 2010—2018 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2020 Sam Hocevar <sam@hocevar.net>
// © 2013—2015 Guillaume Bittoun <guillaume.bittoun@gmail.com>
//
// Lol Engine is free software. It comes without any warranty, to
@@ -14,12 +14,12 @@
#pragma once

//
// Simple map utilities
// --------------------
// The map utilities
// —————————————————
// Contains some utilities to work with std::map objects.
//

#include <lol/base/array.h>

#include <vector>
#include <map>

namespace lol
@@ -43,11 +43,11 @@ static inline bool try_get(T const &m, typename T::key_type const &key,
}

template <typename T>
static inline array<typename T::key_type> keys(T const &m)
static inline std::vector<typename T::key_type> keys(T const &m)
{
array<typename T::key_type> ret;
std::vector<typename T::key_type> ret;
for (auto const &it : m)
ret << it.first;
ret.push_back(it.first);
return ret;
}


include/lol/base/string.h → include/lol/base/private/string.h Wyświetl plik

@@ -19,11 +19,10 @@
// Contains some utilities to work with std::string objects.
//

#include <lol/base/features.h>
#include <lol/base/core.h>
#include "features.h"

#include <vector>
#include <string>
#include <vector> // std::vector
#include <string> // std::basic_string
#include <algorithm> // std::transform
#include <cstdarg> // va_list
#include <cctype> // size_t

+ 1
- 2
include/lol/base/thread.h Wyświetl plik

@@ -17,8 +17,7 @@
// —————————————————————
//

#include <lol/base/features.h>
#include <lol/base/core.h>
#include <lol/base/core.h> // os::getenv

#include <functional> // std::function
#include <thread>


+ 17
- 0
include/lol/base/utils.h Wyświetl plik

@@ -0,0 +1,17 @@
//
// 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

#include "private/string.h"
#include "private/map.h"


+ 2
- 2
include/lol/math/polynomial.h Wyświetl plik

@@ -19,9 +19,9 @@
// added guarantee that the leading coefficient is always non-zero.
//

#include <lol/base/features.h>
#include <lol/base/core.h>
#include "../base/private/features.h"

#include <vector> // std::vector
#include <functional> // std::function
#include <tuple> // std::tuple
#include <cassert> // assert()


+ 1
- 1
include/lol/math/private/matrix.h Wyświetl plik

@@ -19,7 +19,7 @@

#include <ostream>

#include <lol/math/private/ops.h>
#include "ops.h"
#include <lol/math/vector.h>

#if _WIN32


+ 0
- 1
include/lol/math/private/ops.h Wyświetl plik

@@ -21,7 +21,6 @@
#include <type_traits>

#include <lol/math/half.h>
#include <lol/math/real.h>

namespace lol
{


+ 1
- 1
include/lol/math/rand.h Wyświetl plik

@@ -17,7 +17,7 @@
// ————————————————————————————
//

#include <lol/base/features.h>
#include "../base/private/features.h"

#include <cassert>
#include <cstdlib>


+ 5
- 5
include/lol/math/real.h Wyświetl plik

@@ -17,12 +17,12 @@
// —————————————————————
//

#include <lol/base/features.h>
#include <lol/base/core.h>
#include "../base/private/features.h"

#include <vector>
#include <string>
#include <cstdint>
#include <limits> // std::numeric_limits
#include <vector> // std::vector
#include <string> // std::string
#include <cstdint> // int64_t etc.

#if _MSC_VER
# pragma push_macro("min")


Ładowanie…
Anuluj
Zapisz