[Phylobase-commits] r297 - in pkg/src: RcppSrc ncl/ncl

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Nov 23 19:10:20 CET 2008


Author: bbolker
Date: 2008-11-23 19:10:20 +0100 (Sun, 23 Nov 2008)
New Revision: 297

Modified:
   pkg/src/RcppSrc/Rcpp.cpp
   pkg/src/ncl/ncl/ncl.h
Log:
 added std:: prefix and added another limits.h --
fixes compile on Ubuntu intrepid and, hopefully, on 
R-forge ??




Modified: pkg/src/RcppSrc/Rcpp.cpp
===================================================================
--- pkg/src/RcppSrc/Rcpp.cpp	2008-11-21 14:35:39 UTC (rev 296)
+++ pkg/src/RcppSrc/Rcpp.cpp	2008-11-23 18:10:20 UTC (rev 297)
@@ -881,11 +881,12 @@
 // a setjmp() call), and he suggested the following work-around.
 char *copyMessageToR(const char* const mesg) {
     char* Rmesg;
-    char* prefix = "Exception: ";
-    void* Rheap = R_alloc(std::strlen(prefix)+std::strlen(mesg)+1,sizeof(char));
+    const char* prefix = "Exception: ";
+    // BMB commented out "std::" prefix before strlen
+    void* Rheap = R_alloc(strlen(prefix)+strlen(mesg)+1,sizeof(char));
     Rmesg = static_cast<char*>(Rheap);
-    std::strcpy(Rmesg, prefix);
-    std::strcat(Rmesg, mesg);
+    strcpy(Rmesg, prefix);
+    strcat(Rmesg, mesg);
     return Rmesg;
 }
 

Modified: pkg/src/ncl/ncl/ncl.h
===================================================================
--- pkg/src/ncl/ncl/ncl.h	2008-11-21 14:35:39 UTC (rev 296)
+++ pkg/src/ncl/ncl/ncl.h	2008-11-23 18:10:20 UTC (rev 297)
@@ -26,6 +26,8 @@
 #	define vsnprintf _vsnprintf
 #endif
 
+#	include <limits.h> // BMB: UINT_MAX also required outside conditional, at least on Linux bolker-lap2 2.6.27-8-generic #1 SMP Thu Nov 6 17:33:54 UTC 2008 i686 GNU/Linux; g++ (Ubuntu 4.3.2-1ubuntu11) 4.3.2
+
 #if !defined(__DECCXX)
 #	include <cassert>
 #	include <cctype>



More information about the Phylobase-commits mailing list