cpuid: add null fallback
This commit is contained in:
parent
c5633a32c5
commit
3a518fbac8
@ -194,7 +194,11 @@ if (host_cpu STREQUAL "x86_64")
|
|||||||
cpuid/x86.hpp
|
cpuid/x86.hpp
|
||||||
)
|
)
|
||||||
else ()
|
else ()
|
||||||
message (FATAL_ERROR "Unknown architecture ${host_cpu}")
|
message (WARNING "Unknown architecture ${host_cpu}. Defaulting to null implementation")
|
||||||
|
list (APPEND UTIL_FILES
|
||||||
|
cpuid/none.cpp
|
||||||
|
cpuid/none.hpp
|
||||||
|
)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
|
19
cpuid/none.cpp
Normal file
19
cpuid/none.cpp
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*
|
||||||
|
* Copyright 2019 Danny Robson <danny@nerdcruft.net>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "none.hpp"
|
||||||
|
|
||||||
|
#include <ostream>
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
std::ostream&
|
||||||
|
cruft::cpu::operator<< (std::ostream &os, none const &)
|
||||||
|
{
|
||||||
|
return os << "{ }";
|
||||||
|
}
|
17
cpuid/none.hpp
Normal file
17
cpuid/none.hpp
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*
|
||||||
|
* Copyright 2019 Danny Robson <danny@nerdcruft.net>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <iosfwd>
|
||||||
|
|
||||||
|
namespace cruft::cpu {
|
||||||
|
struct none { };
|
||||||
|
|
||||||
|
std::ostream& operator<< (std::ostream &os, none const &);
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user