[PPL-devel] [GIT] ppl/ppl(master): Improved portability to Solaris.

Roberto Bagnara bagnara at cs.unipr.it
Sun Aug 21 08:19:36 CEST 2011


Module: ppl/ppl
Branch: master
Commit: 4006d8772e751993e6e9b099116296614e9508ab
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=4006d8772e751993e6e9b099116296614e9508ab

Author: Roberto Bagnara <bagnara at cs.unipr.it>
Date:   Sun Aug 21 08:14:36 2011 +0200

Improved portability to Solaris.
(Thanks to Dagobert Michelsen and Maciej Blizinski.)

---

 interfaces/Java/jni/ppl_java_globals.cc |   10 ++++++++++
 tests/Box/refinewithconstraints1.cc     |    8 ++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/interfaces/Java/jni/ppl_java_globals.cc b/interfaces/Java/jni/ppl_java_globals.cc
index 019d02f..57b7fb8 100644
--- a/interfaces/Java/jni/ppl_java_globals.cc
+++ b/interfaces/Java/jni/ppl_java_globals.cc
@@ -735,7 +735,17 @@ Java_parma_1polyhedra_1library_Parma_1Polyhedra_1Library_version_1beta
 JNIEXPORT jstring JNICALL
 Java_parma_1polyhedra_1library_Parma_1Polyhedra_1Library_version
 (JNIEnv* env, jclass) {
+#if defined(__sun) || defined(__sun__)
+
+  // Some versions of Solaris declare a version() function that causes
+  // the following function call to be ambiguous.
+  return env->NewStringUTF(Parma_Polyhedra_Library::version());
+
+#else // !(defined(__sun) || defined(__sun__))
+
   return env->NewStringUTF(version());
+
+#endif // !(defined(__sun) || defined(__sun__))
 }
 
 JNIEXPORT jstring JNICALL
diff --git a/tests/Box/refinewithconstraints1.cc b/tests/Box/refinewithconstraints1.cc
index ac4c91f..b1ba961 100644
--- a/tests/Box/refinewithconstraints1.cc
+++ b/tests/Box/refinewithconstraints1.cc
@@ -23,6 +23,14 @@ site: http://www.cs.unipr.it/ppl/ . */
 
 #include "ppl_test.hh"
 
+#if defined(__sun) || defined(__sun__)
+
+// Some versions of Solaris define R1 in /usr/include/ia32/sys/reg.h.
+// This conflicts with the use or R1 being made in this proram.
+# undef R1
+
+#endif // defined(__sun) || defined(__sun__)
+
 namespace {
 
 bool




More information about the PPL-devel mailing list