Skip to content

Commit 00f9faa

Browse files
comment out conio.h usage for windows systems, so that users can uncomment it depending on whether their compiler supports it or not
1 parent b82d661 commit 00f9faa

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/cppsafeio.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@
55
#include <stdexcept>
66
#include <limits>
77

8+
89
#if defined _WIN32
9-
#include <conio.h>
10+
//#include <conio.h> //uncomment if your compiler supports conio.h
1011
#endif
1112

1213
void CppSafeIO::clearConsole()
1314
{
1415
#if defined _WIN32
1516

16-
clrscr();
17+
system("cls");
18+
//clrsrc(); //uncomment if your compiler supports conio.h, and comment out the previous statement
1719

1820
#elif defined (__LINUX__) || defined(__gnu_linux__) || defined(__linux__)
1921

@@ -24,7 +26,7 @@ void CppSafeIO::clearConsole()
2426

2527
std::cout << "\x1b[2J\x1b[H";
2628

27-
#elif defined (__APPLE__)
29+
#elif defined (__APPLE__)
2830

2931
system("clear");
3032

0 commit comments

Comments
 (0)