diff --git a/src/impl/list_ports/list_ports_linux.cc b/src/impl/list_ports/list_ports_linux.cc index 14c154b..cb5e343 100644 --- a/src/impl/list_ports/list_ports_linux.cc +++ b/src/impl/list_ports/list_ports_linux.cc @@ -1,3 +1,5 @@ +#if defined(__linux__) + /* * Copyright (c) 2014 Craig Lilley * This software is made available under the terms of the MIT licence. @@ -329,3 +331,5 @@ serial::list_ports() return results; } + +#endif // defined(__linux__) diff --git a/src/impl/list_ports/list_ports_osx.cc b/src/impl/list_ports/list_ports_osx.cc index bf819d4..29da120 100644 --- a/src/impl/list_ports/list_ports_osx.cc +++ b/src/impl/list_ports/list_ports_osx.cc @@ -1,3 +1,5 @@ +#if defined(__APPLE__) + #include #include @@ -278,4 +280,6 @@ serial::list_ports(void) } return devices_found; -} \ No newline at end of file +} + +#endif // defined(__APPLE__) diff --git a/src/impl/list_ports/list_ports_win.cc b/src/impl/list_ports/list_ports_win.cc index e792f93..4e6e0cf 100644 --- a/src/impl/list_ports/list_ports_win.cc +++ b/src/impl/list_ports/list_ports_win.cc @@ -1,3 +1,5 @@ +#if defined(_WIN32) + /* * Copyright (c) 2014 Craig Lilley * This software is made available under the terms of the MIT licence. @@ -125,3 +127,5 @@ serial::list_ports() return devices_found; } + +#endif // #if defined(_WIN32)