From 00c47b8a04ba14fa5b33bfb8581ec6e5d724e837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Thu, 13 Oct 2016 18:24:10 +0200 Subject: [PATCH] Fix clang builds Redeclaring the same typedef is not legal in C < 11, but a forward-declaration works just fine for having a pointer to struct. No changes needed in .cpp, as it includes the `typedef` from `object.h` (via `scenario.h`). --- src/ScenarioRepository.h | 4 ++-- src/interface/window.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ScenarioRepository.h b/src/ScenarioRepository.h index e36b609c92..6a653bd44e 100644 --- a/src/ScenarioRepository.h +++ b/src/ScenarioRepository.h @@ -22,7 +22,7 @@ #define MAX_PATH 260 #endif -typedef struct rct_object_entry rct_object_entry; +struct rct_object_entry; typedef struct scenario_highscore_entry { @@ -86,7 +86,7 @@ extern "C" size_t scenario_repository_get_count(); const scenario_index_entry *scenario_repository_get_by_index(size_t index); bool scenario_repository_try_record_highscore(const utf8 * scenarioFileName, money32 companyValue, const utf8 * name); - void scenario_translate(scenario_index_entry * scenarioEntry, const rct_object_entry * stexObjectEntry); + void scenario_translate(scenario_index_entry * scenarioEntry, const struct rct_object_entry * stexObjectEntry); #ifdef __cplusplus } diff --git a/src/interface/window.h b/src/interface/window.h index 85ed8513a6..c0587b3ef2 100644 --- a/src/interface/window.h +++ b/src/interface/window.h @@ -25,11 +25,10 @@ #include "../ride/track_design.h" #include "../ride/vehicle.h" #include "../scenario.h" +#include "../ScenarioRepository.h" #include "../world/park.h" #include "colour.h" -typedef struct scenario_index_entry scenario_index_entry; - struct rct_window; union rct_window_event; extern uint16 TextInputDescriptionArgs[4];