mirror of https://github.com/stella-emu/stella.git
Some more const updates for Mac port.
This commit is contained in:
parent
ad850959c0
commit
5258d05167
|
@ -101,14 +101,14 @@ StringList SerialPortMACOS::portNames()
|
||||||
|
|
||||||
// Check if port is valid; for now that means if it can be opened
|
// Check if port is valid; for now that means if it can be opened
|
||||||
// Eventually we may extend this to do more intensive checks
|
// Eventually we may extend this to do more intensive checks
|
||||||
auto isPortValid = [](const string& port) {
|
const auto isPortValid = [](const string& port) {
|
||||||
int handle = open(port.c_str(), O_RDWR | O_NOCTTY | O_NONBLOCK);
|
const int handle = open(port.c_str(), O_RDWR | O_NOCTTY | O_NONBLOCK);
|
||||||
if(handle > 0) close(handle);
|
if(handle > 0) close(handle);
|
||||||
return handle > 0;
|
return handle > 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Get all possible devices in the '/dev' directory
|
// Get all possible devices in the '/dev' directory
|
||||||
FilesystemNode::NameFilter filter = [](const FilesystemNode& node) {
|
const FilesystemNode::NameFilter filter = [](const FilesystemNode& node) {
|
||||||
return BSPF::startsWithIgnoreCase(node.getPath(), "/dev/cu.usb");
|
return BSPF::startsWithIgnoreCase(node.getPath(), "/dev/cu.usb");
|
||||||
};
|
};
|
||||||
FSList portList;
|
FSList portList;
|
||||||
|
|
Loading…
Reference in New Issue