[Liblas-commits] hg-main-tree: attempt some degree of portability...

liblas-commits at liblas.org liblas-commits at liblas.org
Thu Aug 11 21:03:01 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/1e491f1d3674
changeset: 1059:1e491f1d3674
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Thu Aug 11 18:02:50 2011 -0700
description:
attempt some degree of portability...

diffstat:

 test/unit/Support.cpp |  10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diffs (28 lines):

diff -r 8dc1ec49b08e -r 1e491f1d3674 test/unit/Support.cpp
--- a/test/unit/Support.cpp	Thu Aug 11 18:00:15 2011 -0700
+++ b/test/unit/Support.cpp	Thu Aug 11 18:02:50 2011 -0700
@@ -337,7 +337,12 @@
 
     output = "";
     
+#ifdef PDAL_COMPILER_MSVC
     FILE* fp = _popen(cmd.c_str(), "r");
+#else
+    FILE* fp = popen(cmd.c_str(), "r");
+#endif
+
     while (!feof(fp))
     {
         if (fgets(buf, maxbuf, fp) == NULL)
@@ -353,6 +358,11 @@
         output += buf;
     }
 
+#ifdef PDAL_COMPILER_MSVC
     int stat = _pclose(fp);
+#else
+    int stat = pclose(fp);
+#endif
+
     return stat;
 }


More information about the Liblas-commits mailing list