From b46681e8cc1193228e6d1e388356179d865da504 Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Wed, 2 Jul 2014 10:47:45 -0500 Subject: [PATCH 1/2] Add defines to new list_ports methods to compile on OSX. --- src/impl/list_ports/list_ports_linux.cc | 4 ++++ src/impl/list_ports/list_ports_osx.cc | 6 +++++- src/impl/list_ports/list_ports_win.cc | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) 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..fa1aeb8 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) From 24a8722f3ea12d235b192ebe12529b830efdab9c Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Wed, 2 Jul 2014 11:18:11 -0500 Subject: [PATCH 2/2] Fix typo. --- src/impl/list_ports/list_ports_osx.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/impl/list_ports/list_ports_osx.cc b/src/impl/list_ports/list_ports_osx.cc index fa1aeb8..29da120 100644 --- a/src/impl/list_ports/list_ports_osx.cc +++ b/src/impl/list_ports/list_ports_osx.cc @@ -1,4 +1,4 @@ -#if defined(_APPLE_) +#if defined(__APPLE__) #include #include @@ -282,4 +282,4 @@ serial::list_ports(void) return devices_found; } -#endif // defined(_APPLE_) +#endif // defined(__APPLE__)