<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 3, 2014 at 6:17 AM, JJ Allaire <span dir="ltr"><<a href="mailto:jj.allaire@gmail.com" target="_blank">jj.allaire@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">There is one way currently to get type definitions into RcppExports.cpp -- simply add a header file with the same name as your package to inst/include. For example, if your package is named "foobar" then you place the type definitions in:<div>


<br></div><div>inst/include/foobar.h</div><div><br></div><div>This file will be automatically included in RcppExports.cpp. It will also be automatically included when another user does an Rcpp::depends on your package (for sourceCpp or compileAttributes) so they get the benefit of the type definitions as well).</div>

</div></blockquote><div><br></div><div>Ah. Excellent. Thanks for the tip.</div><div><br></div><div>It would still be nice to have a means to autogenerate the R wrapper without emitting the prototype as that will I think generate a redeclaration error.</div>

<div><br></div><div>THK</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">
<div><br></div><div>J.J.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 2, 2014 at 1:11 PM, Tim Keitt <span dir="ltr"><<a href="mailto:tkeitt@utexas.edu" target="_blank">tkeitt@utexas.edu</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I am wondering if anyone has considered the following:<div><br></div><div>// [[Rcpp::include(header.h, extC-bool, namesp-optional)]]</div>


<div><br></div><div>to include header.h in RcppExports.cpp (optionally wrapping it with extern "C" and putting it in a namespace)</div>

<div><br></div><div>and</div><div><br></div><div>// [[Rcpp::wrap(myType myFunc(const myType& x))]]</div><div><br></div><div>which would do exactly what Rcpp::export does (generates a .Call-able symbol + R function, but omits the prototype for myFunc in RcppExports.cpp). That would allow the function and type definitions to appear in header.h.</div>




<div><br></div><div>THK</div><span class="HOEnZb"><font color="#888888"><span><font color="#888888"><div><div><br></div>-- <br><div dir="ltr"><a href="http://www.keittlab.org/" target="_blank">http://www.keittlab.org/</a></div>


</div></font></span></font></span></div><span class="HOEnZb"><font color="#888888">
<br>_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org" target="_blank">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br></font></span></blockquote></div><br></div>


<br>_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br></blockquote></div><br><br clear="all"><div>

<br></div>-- <br><div dir="ltr"><a href="http://www.keittlab.org/" target="_blank">http://www.keittlab.org/</a></div>
</div></div>