TF++, Miscellaneous classes and modules in C++:

◆ cpu_type()

void cpu_type ( )

Ask for CPU type and print result.

Examples:
tests/fortraniotest.cc.

Definition at line 115 of file fortraniotest.cc.

References tfxx::ioswap::cpu(), tfxx::ioswap::cpu_Intel, tfxx::ioswap::cpu_Motorola, and tfxx::ioswap::cpu_unknown.

Referenced by main().

116 {
117  switch (tfxx::ioswap::cpu()) {
119  cout << "We are running on an Intel type CPU" << endl;
120  break;
122  cout << "We are running on a Motorola type CPU" << endl;
123  break;
125  cout << "The type of this CPU is unknown" << endl;
126  break;
127  default:
128  cerr << "ERROR: illegal return value from " <<
129  "tfxx::ioswap::cpu()" << endl;
130  abort();
131  }
132 }
Motorola CPU.
Definition: bytesex.h:108
Ecpu_type cpu()
Check CPU model. ,.
Definition: ioswap.cc:80
Here is the call graph for this function:
Here is the caller graph for this function: