Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
flagarde committed Nov 6, 2023
1 parent 16f968b commit bda4bb2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cpp-terminal/platforms/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ Term::Private::FileHandler::Handle Term::Private::FileHandler::handle() { return

int Term::Private::FileInitializer::m_counter = {0};

///
///@brief Attach the console
///
/// Check if a console is attached to the process. If not, try to attach to the console. If there is no console, then create one. \b stdin, \b stdout, \b stderr are check and opened if necessary.
/// On error, on window, a message box is raised.
///
void Term::Private::FileInitializer::attachConsole()
try
{
Expand Down Expand Up @@ -131,7 +137,8 @@ catch(const Term::Exception& exception)
{
detachConsole();
#if defined(_WIN32)
MessageBoxW(nullptr, Term::Private::to_wide(std::string(exception.what()) + "\nPlease contact : " + Term::homepage()).c_str(), Term::Private::to_wide(std::string("cpp-terminal ") + Term::Version::string()).c_str(), MB_OK | MB_ICONERROR | MB_DEFBUTTON1);
MessageBoxW(nullptr, Term::Private::to_wide(exception.what()).c_str(), Term::Private::to_wide("cpp-terminal").c_str(), MB_OK | MB_ICONERROR | MB_DEFBUTTON1);
std::exit(exception.code());

Check warning on line 141 in cpp-terminal/platforms/file.cpp

View workflow job for this annotation

GitHub Actions / msvc2022 win32 (c++11)

'argument': conversion from 'int64_t' to 'int', possible loss of data [D:\a\cpp-terminal\cpp-terminal\build\cpp-terminal\platforms\cpp-terminal-platforms.vcxproj]

Check warning on line 141 in cpp-terminal/platforms/file.cpp

View workflow job for this annotation

GitHub Actions / msvc2022 x64 (c++14)

'argument': conversion from 'int64_t' to 'int', possible loss of data [D:\a\cpp-terminal\cpp-terminal\build\cpp-terminal\platforms\cpp-terminal-platforms.vcxproj]

Check warning on line 141 in cpp-terminal/platforms/file.cpp

View workflow job for this annotation

GitHub Actions / msvc2022 win32 (c++14)

'argument': conversion from 'int64_t' to 'int', possible loss of data [D:\a\cpp-terminal\cpp-terminal\build\cpp-terminal\platforms\cpp-terminal-platforms.vcxproj]

Check warning on line 141 in cpp-terminal/platforms/file.cpp

View workflow job for this annotation

GitHub Actions / msvc2022 win32 (c++17)

'argument': conversion from 'int64_t' to 'int', possible loss of data [D:\a\cpp-terminal\cpp-terminal\build\cpp-terminal\platforms\cpp-terminal-platforms.vcxproj]

Check warning on line 141 in cpp-terminal/platforms/file.cpp

View workflow job for this annotation

GitHub Actions / msvc2022 x64 (c++11)

'argument': conversion from 'int64_t' to 'int', possible loss of data [D:\a\cpp-terminal\cpp-terminal\build\cpp-terminal\platforms\cpp-terminal-platforms.vcxproj]

Check warning on line 141 in cpp-terminal/platforms/file.cpp

View workflow job for this annotation

GitHub Actions / msvc2022 win32 (c++20)

'argument': conversion from 'int64_t' to 'int', possible loss of data [D:\a\cpp-terminal\cpp-terminal\build\cpp-terminal\platforms\cpp-terminal-platforms.vcxproj]

Check warning on line 141 in cpp-terminal/platforms/file.cpp

View workflow job for this annotation

GitHub Actions / msvc2022 x64 (c++17)

'argument': conversion from 'int64_t' to 'int', possible loss of data [D:\a\cpp-terminal\cpp-terminal\build\cpp-terminal\platforms\cpp-terminal-platforms.vcxproj]
#endif
throw;

Check warning on line 143 in cpp-terminal/platforms/file.cpp

View workflow job for this annotation

GitHub Actions / msvc2022 win32 (c++11)

unreachable code [D:\a\cpp-terminal\cpp-terminal\build\cpp-terminal\platforms\cpp-terminal-platforms.vcxproj]

Check warning on line 143 in cpp-terminal/platforms/file.cpp

View workflow job for this annotation

GitHub Actions / msvc2022 x64 (c++14)

unreachable code [D:\a\cpp-terminal\cpp-terminal\build\cpp-terminal\platforms\cpp-terminal-platforms.vcxproj]

Check warning on line 143 in cpp-terminal/platforms/file.cpp

View workflow job for this annotation

GitHub Actions / msvc2022 win32 (c++14)

unreachable code [D:\a\cpp-terminal\cpp-terminal\build\cpp-terminal\platforms\cpp-terminal-platforms.vcxproj]

Check warning on line 143 in cpp-terminal/platforms/file.cpp

View workflow job for this annotation

GitHub Actions / msvc2022 win32 (c++17)

unreachable code [D:\a\cpp-terminal\cpp-terminal\build\cpp-terminal\platforms\cpp-terminal-platforms.vcxproj]

Check warning on line 143 in cpp-terminal/platforms/file.cpp

View workflow job for this annotation

GitHub Actions / msvc2022 x64 (c++11)

unreachable code [D:\a\cpp-terminal\cpp-terminal\build\cpp-terminal\platforms\cpp-terminal-platforms.vcxproj]

Check warning on line 143 in cpp-terminal/platforms/file.cpp

View workflow job for this annotation

GitHub Actions / msvc2022 win32 (c++20)

unreachable code [D:\a\cpp-terminal\cpp-terminal\build\cpp-terminal\platforms\cpp-terminal-platforms.vcxproj]
}
Expand Down

0 comments on commit bda4bb2

Please sign in to comment.