Skip to content

Commit

Permalink
Fix fno-exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Antidote committed Oct 16, 2015
1 parent b9d79a9 commit 1b67cce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
4 changes: 4 additions & 0 deletions Example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
cmake_minimum_required(VERSION 3.0)
project(Example)
endif()

include_directories(${ATHENA_INCLUDE_DIR})
add_executable(Example
main.cpp)

if(GEKKO)
include_directories(${LIBOGCDIR}/include)
link_directories(${LIGOGCDIR}/lib/wii)
target_link_libraries(Example AthenaCore z wiiuse bte ogc m)
else()
#TODO: add normal link libraries
Expand Down
16 changes: 5 additions & 11 deletions src/Athena/FileInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,24 +172,18 @@ bool FileInfo::touch() const
#elif (defined(HW_RVL) || defined(HW_DOL)) && defined(GEKKO)
// Generic portable version, not extremely reliable but does work
atUint64 val = 0xCDCDCDCDCD;
try
{
Athena::io::FileReader reader(m_path.c_str());
val = reader.readUint64();
}
catch(...)
{
if (reader.isOpen())
val = reader.readUint64();
}

try
{
Athena::io::FileWriter writer(m_path, false);
if (val != 0xCDCDCDCDCD)
if (val != 0xCDCDCDCDCD && writer.isOpen())
writer.writeUint64(val);
}
catch(...)
{
return false;
else if (!writer.isOpen())
return false;
}

#endif
Expand Down

0 comments on commit 1b67cce

Please sign in to comment.