base/systeminfo.cc
std::string SystemInfo::GetMachineModel() {
  if (!machine_model_.empty()) {
    return machine_model_;
  }

#if defined(WEBRTC_MAC)
  char buffer[128];
  size_t length = sizeof(buffer);
  int error = sysctlbyname("hw.model", buffer, &length, NULL, 0);
  if (!error) {
    machine_model_.assign(buffer, length - 1);
  } else {
    machine_model_.clear();
  }
#else
  machine_model_ = "Not available";
#endif

  return machine_model_;
}
// Return the name of the machine model we are currently running on.
// This is a human readable string that consists of the name and version
// number of the hardware, i.e 'MacBookAir1,1'. Returns an empty string if
// model can not be determined. The string is cached for subsequent calls.
Return the name of the machine model we are currently running on.
This is a human readable string that consists of the name and version
number of the hardware, i.e 'MacBookAir1,1'. Returns an empty string if
model can not be determined. The string is cached for subsequent calls.
Return the name of the machine model we are currently running on . This is a human readable string that consists of the name and version number of the hardware i . e ' MacBookAir1 1 ' . Returns an empty string if model can not be determined . The string is cached for subsequent calls .
std::string SystemInfo::GetMachineModel() {
  if (!machine_model_.empty()) {
    return machine_model_;
  }
#if defined(WEBRTC_MAC)
  char buffer[128];
  size_t length = sizeof(buffer);
  int error = sysctlbyname("hw.model", buffer, &length, NULL, 0);
  if (!error) {
    machine_model_.assign(buffer, length - 1);
  } else {
    machine_model_.clear();
  }
#else
  machine_model_ = "Not available";
#endif
  return machine_model_;
}
std :: string SystemInfo :: GetMachineModel ( ) { if ( ! machine_model_ . empty ( ) ) { return machine_model_ ; } #if defined ( WEBRTC_MAC ) char buffer [ 128 ] ; size_t length = sizeof ( buffer ) ; int error = sysctlbyname ( " " , buffer , & length , NULL , 0 ) ; if ( ! error ) { machine_model_ . assign ( buffer , length - 1 ) ; } else { machine_model_ . clear ( ) ; } #else machine_model_ = " " ; #endif return machine_model_ ; }
Return the name of the machine model we are currently running on.
Return the name of the machine model we are currently running on .