Check CPU model. ,.
check for my CPU model
- Returns
- return value indicates the CPU model found
- Examples:
- tests/fortraniotest.cc.
Definition at line 80 of file ioswap.cc.
References tfxx::ioswap::IOUnion< T >::bytes, cpu_Intel, cpu_Motorola, cpu_unknown, magic(), TFXX_assert, and tfxx::ioswap::IOUnion< T >::value.
Referenced by cpu_type().
85 "The integer memory size on this CPU differs from the" 86 "required value of 4");
87 const int& intsize=
sizeof(int);
88 char test_seq[]=
"ABCD";
90 for (
int i=0; i<intsize; i++)
92 u1.bytes[i]=test_seq[i];
93 u2.bytes[i]=test_seq[intsize-i-1];
96 int magnum=
magic(u1.bytes);
98 if (magnum == u1.value)
102 else if (magnum == u2.value)
#define TFXX_assert(C, M)
Check an assertion and report by throwing an exception.
Ecpu_type
Define different CPU type that are recognized.
int magic(const char *const cmagic)
Create a magic number from a character string. ,If represents the input character sequence cmagic an...