[Pkg-running-devel] [antpm] 06/39: realize freebsd build compatibility

Kristof Ralovich ralovich-guest at moszumanska.debian.org
Fri Nov 7 11:13:46 UTC 2014


This is an automated email from the git hooks/post-receive script.

ralovich-guest pushed a commit to branch upstream
in repository antpm.

commit 50d8f342fe31e299f4120851b02d4c65be3abd66
Author: RALOVICH, Kristof <tade60 at freemail.hu>
Date:   Sat Aug 2 15:03:40 2014 +0200

    realize freebsd build compatibility
    
    Add definition of IUCLC.
    
    Fix build with boost 1.42.0, that provides the boost filesystem api v2 only.
---
 src/SerialTty.cpp | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 src/gant/antlib.c |  4 ++++
 2 files changed, 55 insertions(+), 1 deletion(-)

diff --git a/src/SerialTty.cpp b/src/SerialTty.cpp
index 5fe98b9..6612909 100644
--- a/src/SerialTty.cpp
+++ b/src/SerialTty.cpp
@@ -33,14 +33,18 @@
 #include <algorithm>
 #include <vector>
 #include <string>
-#include <boost/thread/thread_time.hpp>
 
+#include <boost/version.hpp>
+#include <boost/thread/thread_time.hpp>
 #include <boost/filesystem.hpp>
 
 #include "Log.hpp"
 #include "common.hpp"
 #include "DeviceSettings.hpp"
 
+#ifndef IUCLC
+# define IUCLC 0
+#endif
 
 namespace fs = boost::filesystem;
 using namespace std;
@@ -89,10 +93,56 @@ find_file_starts_with(const fs::path & dir,
   for( fs::directory_iterator dir_iter(dir) ; dir_iter != end_iter ; ++dir_iter)
   {
     fs::path p = *dir_iter;
+/// from http://www.boost.org/doc/libs/1_49_0/libs/filesystem/v2/doc/index.htm
+
+/// Version 3, a major revision with many new and improved features,
+/// is also available. Version 3 may break some user code written for
+/// Version 2.
+
+// To ease the transition, Boost releases 1.44 through 1.47 will
+// supply both V2 and V3. Version 2 is the default version for Boost
+// release 1.44 and 1.45. Version 3 will be the default starting with
+// release 1.46.
+
+// Define macro BOOST_FILESYSTEM_VERSION as 3 to use Version 3. This
+// will be the default for release 1.46 and later.
+
+// Define macro BOOST_FILESYSTEM_VERSION as 2 to use Version 2. This
+// is the default for release 1.44 and 1.45.
+
+// You may define the BOOST_FILESYSTEM_VERSION macro:
+
+
+// On the build command line; the exact format depends on your
+// compiler or IDE
+
+
+// In your code, before including any filesystem header, #define
+// BOOST_FILESYSTEM_VERSION n
+
+
+// #define BOOST_FILESYSTEM_VERSION n in boost/config/user.hpp. Note
+// #that this approach applies to all uses of Boost.Filesystem.
+
+// Existing code should be moved to version 3 as soon as
+// convenient. New code should be written for version 3.
+
+// Version 2 is deprecated, and will not be included in Boost releases
+// 1.48 and later.
+
+#if (((BOOST_VERSION/100000)==1) && (((BOOST_VERSION / 100) % 1000)<44)) // BOOST_FILESYSTEM_VERSION==2
+    if(std::string(p.leaf()).find(start)==0)
+    {
+      return std::string(p.leaf());
+    }
+#elif BOOST_FILESYSTEM_VERSION==3
     if(p.leaf().string().find(start)==0)
     {
       return p.leaf().string();
     }
+#else
+# error "Unsupported boost filesystem version" ##BOOST_FILESYSTEM_VERSION
+#endif
   }
   return "";
 }
diff --git a/src/gant/antlib.c b/src/gant/antlib.c
index 8b3c58d..e879b8d 100644
--- a/src/gant/antlib.c
+++ b/src/gant/antlib.c
@@ -28,6 +28,10 @@
 #define MAXCHAN 32
 #define BSIZE 8*10000
 
+#ifndef IUCLC
+# define IUCLC 0
+#endif
+
 #define uchar unsigned char
 
 #define hexval(c) ((c >= '0' && c <= '9') ? (c-'0') : ((c&0xdf)-'A'+10))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-running/antpm.git



More information about the Pkg-running-devel mailing list