Fix compilation error on CentOS 7 (gcc 4.8)

libstdc++ that comes with gcc 4.8 doesn't
define `getline(basic_istream<char>&&, std::string&)`
even if it's part of the c++11 standard.
However we can still use the following:
`getline(basic_istream<char>&, std::string&)`.
pull/22313/head
Mateusz Tabaka 2 years ago
parent fc3e393516
commit a89868928b
  1. 3
      modules/videoio/src/cap_obsensor/obsensor_stream_channel_v4l2.cpp

@ -153,7 +153,8 @@ std::vector<UvcDeviceInfo> V4L2Context::queryUvcDeviceInfoList()
}
std::istringstream(modalias.substr(5, 4)) >> std::hex >> uvcDev.vid;
std::istringstream(modalias.substr(10, 4)) >> std::hex >> uvcDev.pid;
std::getline(std::ifstream(video + "/device/interface"), uvcDev.name);
std::ifstream iface(video + "/device/interface");
std::getline(iface, uvcDev.name);
std::ifstream(video + "/device/bInterfaceNumber") >> uvcDev.mi;
uvcDevMap.insert({ interfaceRealPath, uvcDev });
}

Loading…
Cancel
Save