00001 // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*- 00002 // 00003 // RcppCommon.h: Rcpp R/C++ interface class library -- common include and defines statements 00004 // 00005 // Copyright (C) 2005 - 2006 Dominick Samperi 00006 // Copyright (C) 2008 - 2009 Dirk Eddelbuettel 00007 // 00008 // This file is part of Rcpp. 00009 // 00010 // Rcpp is free software: you can redistribute it and/or modify it 00011 // under the terms of the GNU General Public License as published by 00012 // the Free Software Foundation, either version 2 of the License, or 00013 // (at your option) any later version. 00014 // 00015 // Rcpp is distributed in the hope that it will be useful, but 00016 // WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 // GNU General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU General Public License 00021 // along with Rcpp. If not, see <http://www.gnu.org/licenses/>. 00022 00023 #ifndef RcppCommon_h 00024 #define RcppCommon_h 00025 00026 #include <iostream> 00027 #include <sstream> 00028 #include <string> 00029 #include <list> 00030 #include <map> 00031 #include <stdexcept> 00032 #include <vector> 00033 00034 // include R headers, but set R_NO_REMAP and access everything via Rf_ prefixes 00035 #define R_NO_REMAP 00036 00037 #include <R.h> 00038 #include <Rinternals.h> 00039 00040 // #ifdef BUILDING_DLL 00041 // #define RcppExport extern "C" __declspec(dllexport) 00042 // #else 00043 #define RcppExport extern "C" 00044 // #endif 00045 00046 char *copyMessageToR(const char* const mesg); 00047 00048 // simple logging help 00049 inline void logTxtFunction(const char* file, const int line, const char* expression); 00050 00051 //#define logTxt(x) logTxtFunction(__FILE__, __LINE__, x); 00052 #define logTxt(x) 00053 00054 #endif