Skip to content

Commit 6d5b104

Browse files
committed
feat: reafctor export symbols
- unify the complex and complicated #ifdef chains for windows, MSYS2, gcc etc. - also rename the files to export_symbols so that it is not called windows.hpp
1 parent 3ecef8b commit 6d5b104

File tree

98 files changed

+427
-428
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+427
-428
lines changed

src/discord/core.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <core/helper/expected.hpp>
66
#include <core/helper/types.hpp>
77

8-
#include "../helper/windows.hpp"
8+
#include "../helper/export_symbols.hpp"
99

1010
#include <chrono>
1111
#ifdef _WIN32
@@ -58,7 +58,7 @@ namespace constants::discord {
5858
// manually synchronized to https://discord.com/developers/applications/1220147916371394650/rich-presence/assets
5959
enum class ArtAsset : u8 { Logo };
6060

61-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] std::string get_asset_key(ArtAsset asset);
61+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED std::string get_asset_key(ArtAsset asset);
6262

6363
} // namespace constants::discord
6464

@@ -116,7 +116,7 @@ struct DiscordActivityWrapper {
116116
}
117117

118118

119-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] const discordpp::Activity& get_raw() const;
119+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED const discordpp::Activity& get_raw() const;
120120
};
121121

122122
enum class DiscordStatus : u8 { Starting = 0, Ok, Error };
@@ -131,7 +131,7 @@ struct DiscordInstance {
131131
public:
132132
OOPETRIS_GRAPHICS_EXPORTED explicit DiscordInstance();
133133

134-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] DiscordStatus get_status();
134+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED DiscordStatus get_status();
135135

136136
OOPETRIS_GRAPHICS_EXPORTED DiscordInstance(DiscordInstance&& old) noexcept;
137137

src/game/bag.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <core/game/tetromino_type.hpp>
44
#include <core/helper/random.hpp>
55

6-
#include "../helper/windows.hpp"
6+
#include "../helper/export_symbols.hpp"
77
#include <array>
88

99
struct Bag final {

src/game/command_line_arguments.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <core/helper/types.hpp>
77
#include <core/helper/utils.hpp>
88

9-
#include "../helper/windows.hpp"
9+
#include "../helper/export_symbols.hpp"
1010

1111
#include <filesystem>
1212
#include <optional>

src/game/game.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <recordings/utility/recording.hpp>
44

55
#include "helper/clock_source.hpp"
6-
#include "helper/windows.hpp"
6+
#include "helper/export_symbols.hpp"
77
#include "input/input_creator.hpp"
88
#include "tetrion.hpp"
99
#include "ui/widget.hpp"
@@ -32,14 +32,14 @@ struct Game : public ui::Widget {
3232

3333
OOPETRIS_GRAPHICS_EXPORTED void render(const ServiceProvider& service_provider) const override;
3434

35-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] Widget::EventHandleResult
35+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED Widget::EventHandleResult
3636
handle_event(const std::shared_ptr<input::InputManager>& input_manager, const SDL_Event& event) override;
3737

3838
OOPETRIS_GRAPHICS_EXPORTED void set_paused(bool paused);
3939

40-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] bool is_paused() const;
40+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED bool is_paused() const;
4141

42-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] bool is_game_finished() const;
42+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED bool is_game_finished() const;
4343

44-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] const std::shared_ptr<input::GameInput>& game_input() const;
44+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED const std::shared_ptr<input::GameInput>& game_input() const;
4545
};

src/game/graphic_helpers.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include <core/core.hpp>
44

5-
#include "helper/windows.hpp"
5+
#include "helper/export_symbols.hpp"
66
#include "manager/service_provider.hpp"
77

88
enum class MinoTransparency : u8 {

src/game/grid.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <core/helper/color.hpp>
55

66
#include "graphics/rect.hpp"
7-
#include "helper/windows.hpp"
7+
#include "helper/export_symbols.hpp"
88
#include "manager/service_provider.hpp"
99
#include "ui/layout.hpp"
1010
#include "ui/widget.hpp"
@@ -26,13 +26,13 @@ struct Grid final : public ui::Widget {
2626

2727
[[nodiscard]] shapes::UPoint tile_size() const;
2828

29-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] double scale_to_original() const;
29+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED double scale_to_original() const;
3030

31-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] shapes::UPoint to_screen_coords(grid::GridPoint grid_coords) const;
31+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED shapes::UPoint to_screen_coords(grid::GridPoint grid_coords) const;
3232

3333
OOPETRIS_GRAPHICS_EXPORTED void render(const ServiceProvider& service_provider) const override;
3434

35-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] helper::BoolWrapper<std::pair<ui::EventHandleType, ui::Widget*>>
35+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED helper::BoolWrapper<std::pair<ui::EventHandleType, ui::Widget*>>
3636
handle_event(const std::shared_ptr<input::InputManager>& input_manager, const SDL_Event& event) override;
3737

3838
private:

src/game/rotation.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include <core/helper/types.hpp>
44

5-
#include "../helper/windows.hpp"
5+
#include "../helper/export_symbols.hpp"
66

77
enum class Rotation : u8 {
88
North = 0,

src/game/simulated_tetrion.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "bag.hpp"
1010
#include "grid.hpp"
11-
#include "helper/windows.hpp"
11+
#include "helper/export_symbols.hpp"
1212
#include "input/game_input.hpp"
1313
#include "manager/service_provider.hpp"
1414
#include "tetromino.hpp"
@@ -123,14 +123,14 @@ struct SimulatedTetrion {
123123
OOPETRIS_GRAPHICS_EXPORTED bool drop_tetromino(SimulationStep simulation_step_index);
124124
OOPETRIS_GRAPHICS_EXPORTED void hold_tetromino(SimulationStep simulation_step_index);
125125

126-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] u8 tetrion_index() const;
127-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] u32 level() const;
128-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] u64 score() const;
129-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] u32 lines_cleared() const;
130-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] const MinoStack& mino_stack() const;
131-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] std::unique_ptr<TetrionCoreInformation> core_information() const;
126+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED u8 tetrion_index() const;
127+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED u32 level() const;
128+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED u64 score() const;
129+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED u32 lines_cleared() const;
130+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED const MinoStack& mino_stack() const;
131+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED std::unique_ptr<TetrionCoreInformation> core_information() const;
132132

133-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] bool is_game_over() const;
133+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED bool is_game_over() const;
134134

135135
private:
136136
template<typename Callable>

src/game/simulation.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <core/helper/expected.hpp>
44
#include <recordings/utility/recording.hpp>
55

6-
#include "helper/windows.hpp"
6+
#include "helper/export_symbols.hpp"
77
#include "input/input_creator.hpp"
88
#include "input/replay_input.hpp"
99
#include "simulated_tetrion.hpp"
@@ -28,5 +28,5 @@ struct Simulation {
2828

2929
OOPETRIS_GRAPHICS_EXPORTED void update();
3030

31-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] bool is_game_finished() const;
31+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED bool is_game_finished() const;
3232
};

src/game/tetrion.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <core/helper/types.hpp>
66
#include <recordings/utility/tetrion_core_information.hpp>
77

8-
#include "helper/windows.hpp"
8+
#include "helper/export_symbols.hpp"
99
#include "input/game_input.hpp"
1010
#include "manager/service_provider.hpp"
1111
#include "simulated_tetrion.hpp"
@@ -44,13 +44,13 @@ struct Tetrion final : public ui::Widget, SimulatedTetrion {
4444
OOPETRIS_GRAPHICS_EXPORTED Tetrion& operator=(Tetrion&& other) noexcept = delete;
4545

4646
OOPETRIS_GRAPHICS_EXPORTED void render(const ServiceProvider& service_provider) const override;
47-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] Widget::EventHandleResult
47+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED Widget::EventHandleResult
4848
handle_event(const std::shared_ptr<input::InputManager>& input_manager, const SDL_Event& event) override;
4949

50-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] Grid* get_grid();
51-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] const Grid* get_grid() const;
52-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] ui::GridLayout* get_text_layout();
53-
OOPETRIS_GRAPHICS_EXPORTED [[nodiscard]] const ui::GridLayout* get_text_layout() const;
50+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED Grid* get_grid();
51+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED const Grid* get_grid() const;
52+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED ui::GridLayout* get_text_layout();
53+
[[nodiscard]] OOPETRIS_GRAPHICS_EXPORTED const ui::GridLayout* get_text_layout() const;
5454

5555
private:
5656
void refresh_texts() override;

0 commit comments

Comments
 (0)