-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
103 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
add_executable(release_bin ${COMMON_SOURCES} main.cpp) | ||
|
||
target_compile_options(release_bin PRIVATE -O3 -g0 -Wdisabled-optimization) | ||
target_link_libraries(release_bin ${REQ_LLVM_LIBRARIES}) | ||
|
||
add_dependencies(release_bin ${COMMON_DEPS}) | ||
|
||
make_exe_symlink(release) | ||
|
||
add_executable(debug_bin ${COMMON_SOURCES} main.cpp) | ||
|
||
target_compile_options(debug_bin PRIVATE -D CRASH_ON_INTERNAL_ERROR -O0 -g3) | ||
if(UNIX) | ||
target_compile_options(release_bin PRIVATE -O3 -g0 -Wdisabled-optimization) | ||
target_compile_options(debug_bin PRIVATE -D CRASH_ON_INTERNAL_ERROR -O0 -g3) | ||
elseif(MSVC) | ||
target_compile_options(release_bin PRIVATE) | ||
target_compile_options(debug_bin PRIVATE /DCRASH_ON_INTERNAL_ERROR ) | ||
endif() | ||
|
||
target_link_libraries(release_bin ${REQ_LLVM_LIBRARIES}) | ||
target_link_libraries(debug_bin ${REQ_LLVM_LIBRARIES}) | ||
|
||
add_dependencies(release_bin ${COMMON_DEPS}) | ||
add_dependencies(debug_bin ${COMMON_DEPS}) | ||
|
||
make_exe_symlink(release) | ||
make_exe_symlink(debug) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
diff --git a/include/termcolor/termcolor.hpp b/include/termcolor/termcolor.hpp | ||
index 4659afd..6be0a25 100644 | ||
--- a/include/termcolor/termcolor.hpp | ||
+++ b/include/termcolor/termcolor.hpp | ||
@@ -26,18 +26,6 @@ | ||
#endif | ||
|
||
|
||
-// This headers provides the `isatty()`/`fileno()` functions, | ||
-// which are used for testing whether a standart stream refers | ||
-// to the terminal. As for Windows, we also need WinApi funcs | ||
-// for changing colors attributes of the terminal. | ||
-#if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX) | ||
-# include <unistd.h> | ||
-#elif defined(TERMCOLOR_OS_WINDOWS) | ||
-# include <io.h> | ||
-# include <windows.h> | ||
-#endif | ||
- | ||
- | ||
#include <iostream> | ||
#include <cstdio> | ||
|
||
@@ -45,6 +33,18 @@ | ||
|
||
namespace termcolor | ||
{ | ||
+ | ||
+ // This headers provides the `isatty()`/`fileno()` functions, | ||
+ // which are used for testing whether a standart stream refers | ||
+ // to the terminal. As for Windows, we also need WinApi funcs | ||
+ // for changing colors attributes of the terminal. | ||
+ #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX) | ||
+ # include <unistd.h> | ||
+ #elif defined(TERMCOLOR_OS_WINDOWS) | ||
+ # include <io.h> | ||
+ # include <windows.h> | ||
+ #endif | ||
+ | ||
// Forward declaration of the `_internal` namespace. | ||
// All comments are below. | ||
namespace _internal | ||
@@ -444,12 +444,13 @@ namespace termcolor | ||
inline | ||
bool is_atty(const std::ostream& stream) | ||
{ | ||
+ return true; | ||
FILE* std_stream = get_standard_stream(stream); | ||
|
||
#if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX) | ||
- return ::isatty(fileno(std_stream)); | ||
+ return isatty(fileno(std_stream)); | ||
#elif defined(TERMCOLOR_OS_WINDOWS) | ||
- return ::_isatty(_fileno(std_stream)); | ||
+ return _isatty(_fileno(std_stream)); | ||
#endif | ||
} | ||
|
||
@@ -457,7 +458,7 @@ namespace termcolor | ||
#if defined(TERMCOLOR_OS_WINDOWS) | ||
//! Change Windows Terminal colors attribute. If some | ||
//! parameter is `-1` then attribute won't changed. | ||
- void win_change_attributes(std::ostream& stream, int foreground, int background) | ||
+ inline void win_change_attributes(std::ostream& stream, int foreground, int background) | ||
{ | ||
// yeah, i know.. it's ugly, it's windows. | ||
static WORD defaultAttributes = 0; |