mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Clean up #includes
Remove unused headers, and avoid relying on transitive inclusions `include-what-you-use` has been very useful for this!
This commit is contained in:
@@ -3,12 +3,9 @@
|
||||
#ifndef RGBDS_MAIN_H
|
||||
#define RGBDS_MAIN_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
|
||||
#include "helpers.hpp"
|
||||
|
||||
extern bool haltNop;
|
||||
extern bool warnOnHaltNop;
|
||||
extern bool optimizeLoads;
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
#ifndef WARNING_H
|
||||
#define WARNING_H
|
||||
|
||||
#include "helpers.hpp"
|
||||
|
||||
extern unsigned int nbErrors, maxErrors;
|
||||
|
||||
enum WarningState { WARNING_DEFAULT, WARNING_DISABLED, WARNING_ENABLED, WARNING_ERROR };
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
#ifndef RGBDS_ERROR_H
|
||||
#define RGBDS_ERROR_H
|
||||
|
||||
#include "platform.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
[[gnu::format(printf, 1, 2)]] void warn(char const *fmt...);
|
||||
|
||||
@@ -3,9 +3,7 @@
|
||||
#ifndef RGBDS_FILE_HPP
|
||||
#define RGBDS_FILE_HPP
|
||||
|
||||
#include <array>
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
#include <fcntl.h>
|
||||
#include <fstream>
|
||||
#include <ios>
|
||||
@@ -13,10 +11,8 @@
|
||||
#include <streambuf>
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <variant>
|
||||
|
||||
#include "helpers.hpp"
|
||||
#include "platform.hpp"
|
||||
|
||||
#include "gfx/main.hpp"
|
||||
|
||||
@@ -4,15 +4,12 @@
|
||||
#define RGBDS_GFX_MAIN_HPP
|
||||
|
||||
#include <array>
|
||||
#include <limits.h>
|
||||
#include <optional>
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "helpers.hpp"
|
||||
|
||||
#include "gfx/rgba.hpp"
|
||||
|
||||
struct Options {
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
|
||||
#include "defaultinitalloc.hpp"
|
||||
|
||||
#include "gfx/main.hpp"
|
||||
|
||||
struct Palette;
|
||||
class ProtoPalette;
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#define RGBDS_GFX_PAL_SORTING_HPP
|
||||
|
||||
#include <array>
|
||||
#include <assert.h>
|
||||
#include <optional>
|
||||
#include <png.h>
|
||||
#include <vector>
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#ifndef RGBDS_GFX_PROTO_PALETTE_HPP
|
||||
#define RGBDS_GFX_PROTO_PALETTE_HPP
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#include "helpers.hpp"
|
||||
#include "linkdefs.hpp"
|
||||
|
||||
// Variables related to CLI options
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
#ifndef RGBDS_LINK_OUTPUT_H
|
||||
#define RGBDS_LINK_OUTPUT_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "link/section.hpp"
|
||||
|
||||
/*
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include "linkdefs.hpp"
|
||||
|
||||
#include "link/main.hpp"
|
||||
#include "link/patch.hpp"
|
||||
|
||||
struct FileStackNode;
|
||||
struct Section;
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
|
||||
// MSVC doesn't have str(n)casecmp, use a suitable replacement
|
||||
#ifdef _MSC_VER
|
||||
#include <string.h>
|
||||
#include <string.h> // IWYU pragma: export
|
||||
#define strcasecmp _stricmp
|
||||
#define strncasecmp _strnicmp
|
||||
#else
|
||||
#include <strings.h>
|
||||
#include <strings.h> // IWYU pragma: export
|
||||
#endif
|
||||
|
||||
// MSVC prefixes the names of S_* macros with underscores,
|
||||
@@ -24,21 +24,21 @@
|
||||
|
||||
// MSVC doesn't use POSIX types or defines for `read`
|
||||
#ifdef _MSC_VER
|
||||
#include <io.h>
|
||||
#include <io.h> // IWYU pragma: export
|
||||
#define STDIN_FILENO 0
|
||||
#define STDOUT_FILENO 1
|
||||
#define STDERR_FILENO 2
|
||||
#define ssize_t int
|
||||
#define SSIZE_MAX INT_MAX
|
||||
#else
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h> // IWYU pragma: export
|
||||
#include <limits.h> // IWYU pragma: export
|
||||
#include <unistd.h> // IWYU pragma: export
|
||||
#endif
|
||||
|
||||
// MSVC uses a different name for O_RDWR, and needs an additional _O_BINARY flag
|
||||
#ifdef _MSC_VER
|
||||
#include <fcntl.h>
|
||||
#include <fcntl.h> // IWYU pragma: export
|
||||
#define O_RDWR _O_RDWR
|
||||
#define S_ISREG(field) ((field) & (_S_IFREG))
|
||||
#define O_BINARY _O_BINARY
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
// Windows has stdin and stdout open as text by default, which we may not want
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#include <io.h>
|
||||
#include <io.h> // IWYU pragma: export
|
||||
#define setmode(fd, mode) _setmode(fd, mode)
|
||||
#else
|
||||
#define setmode(fd, mode) (0)
|
||||
|
||||
Reference in New Issue
Block a user