From f6c82d52ec498f8f73261d58b7811748f6480799 Mon Sep 17 00:00:00 2001 From: tqchen Date: Sat, 25 Jul 2015 21:17:28 -0700 Subject: [PATCH] make solaris happy --- wrapper/xgboost_wrapper.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/wrapper/xgboost_wrapper.cpp b/wrapper/xgboost_wrapper.cpp index fb33d0392..b27132d50 100644 --- a/wrapper/xgboost_wrapper.cpp +++ b/wrapper/xgboost_wrapper.cpp @@ -98,7 +98,14 @@ class Booster: public learner::BoostLearner { private: bool init_model; }; +} // namespace wrapper +} // namespace xgboost +using namespace xgboost::wrapper; + +#ifndef XGBOOST_STRICT_CXX98_ +namespace xgboost { +namespace wrapper { // helper to support threadlocal struct ThreadLocalStore { std::vector data; @@ -126,8 +133,6 @@ static ThreadLocalStore thread_local_store; } // namespace wrapper } // namespace xgboost -using namespace xgboost::wrapper; - /*! \brief macro to guard beginning and end section of all functions */ #define API_BEGIN() try { /*! @@ -173,6 +178,17 @@ const char *XGBSetGetLastError_(const char *str_set) { } return last_error->c_str(); } +#else +// crippled implementation for solaris case +// exception handling is not needed for R, so it is OK. +#define API_BEGIN() +#define API_END_FINALIZE(Finalize) return 0 +#define API_END() return 0 + +const char *XGBSetGetLastError_(const char *str_set) { + return NULL; +} +#endif /*! \brief return str message of the last error */ const char *XGBGetLastError() {