-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCross.hpp
77 lines (61 loc) · 1.84 KB
/
Cross.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
///original file
/// https://github.com/Purpursarkans/Cross
/// https://github.com/Purpursarkans/Cross/blob/main/Cross.hpp
///you can see this file in my other projects, the versions of the files will be different and, perhaps, the code in them will be different, so if you want to see get the latest version of the file, open the original using the links above
///вы можете увидеть этот файл в других моих проектах, версии файлов могут быть другими и, возможно, код в них будет другим, поэтому, если вы хотите увидеть, последнюю версию файла, откройте оригинал по ссылкам выше
#ifndef CROSS_HPP
#define CROSS_HPP
#include <iostream>
#include <chrono>
#include <thread>
#if defined (__x86_64__) || defined(__aarch64__)
#ifdef _WIN64
#define PLATFORM "Windows"
#define PWIN 1
#elif __linux__
#define PLATFORM "Linux"
#define PLIN 1
#else
#define PLATFONR "Unknown"
#endif
#define BIT 64
#else
#define BIT 0
exit (1);
#endif
void pause()
{
#ifdef PWIN
system("pause");
#elif PLIN
system("read -n1 -r -p \"Press any key to continue...\" key; echo -e \"\n\"");
#endif
}
void clear()
{
#ifdef PWIN
system("cls");
#elif PLIN
system("clear");
#endif
}
void check()
{
if(BIT == 64)
{
std::cout << PLATFORM << " x64 " << "detect" << std::endl;
}
else if (BIT != 64)
{
std::cout << "need x64-bit " << PLATFORM << std::endl;
}
}
void Sleep(int sleep)
{
std::this_thread::sleep_for(std::chrono::milliseconds(sleep));
}
void SleepSec(int sleep)
{
std::this_thread::sleep_for(std::chrono::seconds(sleep));
}
#endif