Skip to content

Commit

Permalink
Rename GCC_OLD to GCC_LEGACY
Browse files Browse the repository at this point in the history
  • Loading branch information
z2442 committed Jan 28, 2025
1 parent 2f6c899 commit 25517ce
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 33 deletions.
6 changes: 3 additions & 3 deletions Options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ if(DAEDALUS_GL)
add_compile_definitions(DAEDALUS_GL)
endif()

if(GCC_OLD)
message("GCC_OLD=ON")
add_compile_definitions(GCC_OLD)
if(GCC_LEGACY)
message("GCC_LEGACY=ON")
add_compile_definitions(GCC_LEGACY)
endif()

if(DAEDALUS_GLES)
Expand Down
12 changes: 6 additions & 6 deletions Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")

if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "13.0")
message(STATUS "GCC version is older than 13. Using LibFormat.")
message("GCC_OLD=ON")
option(GCC_OLD "Use LibFormat" ON)
message("GCC_LEGACY=ON")
option(GCC_LEGACY "Use LibFormat" ON)
endif()
endif()

Expand Down Expand Up @@ -226,9 +226,9 @@ endif(CTR)
if(DAEDALUS_SDL)
find_package(SDL2 CONFIG REQUIRED)

if(GCC_OLD)
if(GCC_LEGACY)
find_package(fmt REQUIRED)
endif(GCC_OLD)
endif(GCC_LEGACY)

link_libraries(SDL2::SDL2)
link_libraries(${SDL2_LIBRARIES})
Expand Down Expand Up @@ -304,11 +304,11 @@ link_libraries(ZLIB::ZLIB)
# --- Build ----
add_executable(daedalus ${plat_main})

if(GCC_OLD)
if(GCC_LEGACY)
target_link_libraries(daedalus PRIVATE ${daed_libs} ${default_libraries} ${sys_libraries} fmt::fmt)
else()
target_link_libraries(daedalus PRIVATE ${daed_libs} ${default_libraries} ${sys_libraries} )
endif(GCC_OLD)
endif(GCC_LEGACY)

# --- Post Build ---
## PRX Builds add about 600kb to the binary as they're not stripped at this point. Maybe we
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/RSP_HLE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "Base/Types.h"
#include <cstring>
#include <fstream>
#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
#include <fmt/core.h>
#else
#include <format>
Expand Down Expand Up @@ -64,7 +64,7 @@ extern "C" {
#if 0
static void RDP_DumpRSPCode(char * name, u32 crc, u32 * mem_base, u32 pc_base, u32 len)
{
#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
std::string filename = fmt::format("task_dump_{}_crc_0x{}.txt", name, crc);
#else
std::string filename = std::format("task_dump_{}_crc_0x{}.txt", name, crc);
Expand All @@ -87,7 +87,7 @@ static void RDP_DumpRSPCode(char * name, u32 crc, u32 * mem_base, u32 pc_base, u

char opinfo[400];
SprintRSPOpCodeInfo( opinfo, pc + pc_base, op );
#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
fp << fmt::format("0x{:08x}: <0x{:08x}> {}\n", pc + pc_base, op._u32, opinfo);
#else
fp << std::format("0x{:08x}: <0x{:08x}> {}\n", pc + pc_base, op._u32, opinfo);
Expand Down
2 changes: 1 addition & 1 deletion Source/Debug/DebugLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


#include <fstream>
#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
#include <fmt/core.h>
#else
#include <format>
Expand Down
10 changes: 5 additions & 5 deletions Source/Debug/Dump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <filesystem>
#include <iostream>
#include <fstream>
#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
#include <fmt/core.h>
#else
#include <format>
Expand Down Expand Up @@ -91,7 +91,7 @@ void Dump_DisassembleMIPSRange(std::ofstream& fh, u32 address_offset, const OpCo
#endif

SprintOpCodeInfo( opinfo, address, op );
#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
std::string data = fmt::format("0x{}: <0x{}> {}", address, op._u32, opinfo);
#else
std::string data = std::format("0x{}: <0x{}> {}", address, op._u32, opinfo);
Expand Down Expand Up @@ -142,7 +142,7 @@ void Dump_MemoryRange(std::ofstream& fh, u32 address_offset, const u32 * b, cons
const u32 * p( b );
while( p < e )
{
#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
std::string output = fmt::format("0x{}x: {} {} {} {} ", address, p[0], p[1], p[2], p[3]);
#else
std::string output = std::format("0x{}x: {} {} {} {} ", address, p[0], p[1], p[2], p[3]);
Expand Down Expand Up @@ -176,7 +176,7 @@ void Dump_DisassembleRSPRange(std::ofstream& fh, u32 address_offset, const OpCod
{
char opinfo[400];
SprintRSPOpCodeInfo( opinfo, address, *p );
#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
std::string output = fmt::format("0x{}: <0x{}> {}\n", address, p->_u32, opinfo);
#else
std::string output = std::format("0x{}: <0x{}> {}\n", address, p->_u32, opinfo);
Expand Down Expand Up @@ -265,7 +265,7 @@ void Dump_Strings( const char * p_file_name )
if ( ascii_count >= MIN_LENGTH )
{

#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
std::string output = fmt::format("0x{}", ascii_start);
#else
std::string output = std::format("0x{}", ascii_start);
Expand Down
4 changes: 2 additions & 2 deletions Source/HLEGraphics/CachedTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

#include <vector>
#include <random>
#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
#include <fmt/core.h>
#else
#include <format>
Expand Down Expand Up @@ -351,7 +351,7 @@ void CachedTexture::DumpTexture( const TextureInfo & ti, const std::shared_ptr<C
if( texture != nullptr && texture->HasData() )
{
std::filesystem::path dumpdir = g_ROM.settings.GameName;
#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
std::string filename = fmt::format("{}-{}_{}bpp-{}x{}-{}x{}.png", ti.GetLoadAddress(), ti.GetFormatName(), ti.GetSizeInBits(), 0, 0, ti.GetWidth(), ti.GetHeight() );
#else
std::string filename = std::format("{}-{}_{}bpp-{}x{}-{}x{}.png", ti.GetLoadAddress(), ti.GetFormatName(), ti.GetSizeInBits(), 0, 0, ti.GetWidth(), ti.GetHeight() );
Expand Down
4 changes: 2 additions & 2 deletions Source/HLEGraphics/DLDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#ifdef DAEDALUS_DEBUG_DISPLAYLIST
#include <stdarg.h>
#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
#include <fmt/core.h>
#else
#include <format>
Expand Down Expand Up @@ -485,7 +485,7 @@ DLDebugOutput * DLDebug_CreateFileOutput()

std::filesystem::path dumpdir = "DisplayLists";
dumpdir /= g_ROM.settings.GameName.c_str();
#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
std::string filepath = fmt::format("dl{}.txt", count++);
#else
std::string filepath = std::format("dl{}.txt", count++);
Expand Down
8 changes: 4 additions & 4 deletions Source/SysCTR/UI/InGameMenu.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <3ds.h>
#include <GL/picaGL.h>
#include <stdio.h>
#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
#include <fmt/core.h>
#else
#include <format>
Expand Down Expand Up @@ -49,7 +49,7 @@ static void ExecSaveState(int slot)
savePath /= name;
std::filesystem::create_directories(savePath);

#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
std::string filename = fmt::format("saveslot{}.ss", slot);
#else
std::string filename = std::format("saveslot{}.ss", slot);
Expand All @@ -68,7 +68,7 @@ static void LoadSaveState(int slot)
savePath /= name;
std::filesystem::create_directories(savePath);

#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
std::string filename = fmt::format("saveslot{}.ss", slot);
#else
std::string filename = std::format("saveslot{}.ss", slot);
Expand All @@ -90,7 +90,7 @@ static bool SaveStateExists(int slot)
savePath /= name;
std::filesystem::create_directories(savePath);

#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
std::string filename = fmt::format("saveslot{}.ss", slot);
#else
std::string filename = std::format("saveslot{}.ss", slot);
Expand Down
6 changes: 3 additions & 3 deletions Source/UI/RomSelectorComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <vector>
#include <map>
#include <algorithm>
#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
#include <fmt/core.h>
#else
#include <format>
Expand Down Expand Up @@ -334,7 +334,7 @@ void IRomSelectorComponent::RenderPreview()
{
auto p_rominfo = mRomsList[ mCurrentSelection ];

#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
std::string rom_size = fmt::format("{} MB", p_rominfo->mRomSize / (1024 * 1024));
#else
std::string rom_size = std::format("{} MB", p_rominfo->mRomSize / (1024 * 1024));
Expand Down Expand Up @@ -444,7 +444,7 @@ void IRomSelectorComponent::RenderCategoryList()

// char str[ 16 ];
// snprintf( str, sizeof(str), "%c ", GetCategoryLetter( category ) );
#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
std::string str = fmt::format("{} ", GetCategoryLetter( category));
#else
std::string str = std::format("{} ", GetCategoryLetter( category));
Expand Down
4 changes: 2 additions & 2 deletions Source/UI/SavestateSelectorComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


#include <filesystem>
#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
#include <fmt/core.h>
#else
#include <format>
Expand Down Expand Up @@ -112,7 +112,7 @@ namespace
std::filesystem::path full_directory = save_directory / slot_path;
std::filesystem::create_directory(full_directory);

#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
std::string filename_png = fmt::format("saveslot{}.ss.png", slot_idx);
std::string filename_ss = fmt::format("saveslot{}.ss", slot_idx);
#else
Expand Down
4 changes: 2 additions & 2 deletions Source/Utility/Translate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <vector>
#include <iostream>
#include <string>
#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
#include <fmt/core.h>
#else
#include <format>
Expand Down Expand Up @@ -231,7 +231,7 @@ void Translate_Dump(const std::string string, bool dump)

if (fh.is_open())
{
#if defined(GCC_OLD)
#if defined(GCC_LEGACY)
fh << fmt::format("{:08x},{}\n", HashString(string), string);
#else
fh << std::format("{:08x},{}\n", HashString(string), string);
Expand Down

0 comments on commit 25517ce

Please sign in to comment.