mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:37:36 +00:00
Add the basic character devices to kernel.
This commit is contained in:
parent
12e515735b
commit
aec8ab0a60
13 changed files with 52 additions and 58 deletions
|
@ -6,48 +6,6 @@
|
|||
#define PUBLIC
|
||||
#define PRIVATE static
|
||||
|
||||
template <typename T>
|
||||
T&& move(T& arg)
|
||||
{
|
||||
return static_cast<T&&>(arg);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T min(T a, T b)
|
||||
{
|
||||
return (a < b) ? a : b;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T max(T a, T b)
|
||||
{
|
||||
return (a > b) ? a : b;
|
||||
}
|
||||
|
||||
template<typename T, typename U>
|
||||
void swap(T& a, U& b)
|
||||
{
|
||||
U tmp = move((U&)a);
|
||||
a = (T&&)move(b);
|
||||
b = move(tmp);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
struct identity {
|
||||
typedef T type;
|
||||
};
|
||||
template<typename T>
|
||||
T&& forward(typename identity<T>::type&& param)
|
||||
{ return static_cast<typename identity<T>::type&&>(param); }
|
||||
|
||||
template<typename T, typename U>
|
||||
T exchange(T& a, U&& b)
|
||||
{
|
||||
T tmp = move(a);
|
||||
a = move(b);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
typedef unsigned char BYTE;
|
||||
typedef unsigned short WORD;
|
||||
typedef unsigned int DWORD;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue