From 1dc355a7227e287d13e9d337be39291412f9e3fe Mon Sep 17 00:00:00 2001 From: Valk Richard Li <48872266+ValKmjolnir@users.noreply.github.com> Date: Tue, 7 Jan 2020 00:08:26 +0800 Subject: [PATCH] add system detector --- version2.0/main.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/version2.0/main.cpp b/version2.0/main.cpp index 740647e..f292511 100644 --- a/version2.0/main.cpp +++ b/version2.0/main.cpp @@ -30,10 +30,18 @@ int main() } else if(command=="cls") { +#ifdef _WIN32 +#pragma message("windows system detected.") system("cls"); - // windows system("cls"); - // linux system("clear"); - // macOS system("clear"); +#endif +#ifdef _linux_ +#pragma message("linux system detected.") + system("clear"); +#endif +#ifdef TARGET_OS_MAC +#pragma message("macOS detected.") + system("clear"); +#endif } else if(command=="del") {