Skip to content

Commit ad4f5e0

Browse files
Adjust includes in sample.h, Date.h, and Datetime.h for MinGW
1 parent 07e045e commit ad4f5e0

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

ChangeLog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2016-12-13 Nathan Russell <[email protected]>
2+
3+
* inst/include/Rcpp/sugar/functions/sample.h: Use malloc.h instead of
4+
alloca.h when building on Windows
5+
* inst/include/Rcpp/date_datetime/Date.h: Include time.h when building
6+
on Windows
7+
* inst/include/Rcpp/date_datetime/Datetime.h: Idem
8+
19
2016-12-12 Dirk Eddelbuettel <[email protected]>
210

311
* inst/include/Rcpp/sugar/functions/sample.h: In case sample.h from the

inst/include/Rcpp/date_datetime/Date.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
#ifndef Rcpp__Date_h
2323
#define Rcpp__Date_h
2424

25+
#if defined(WIN32) || defined(__WIN32) || defined(__WIN32__)
26+
#include <time.h>
27+
#endif
28+
2529
namespace Rcpp {
2630

2731
class Date {

inst/include/Rcpp/date_datetime/Datetime.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424

2525
#include <RcppCommon.h>
2626

27+
#if defined(WIN32) || defined(__WIN32) || defined(__WIN32__)
28+
#include <time.h>
29+
#endif
30+
2731
namespace Rcpp {
2832

2933
class Datetime {

inst/include/Rcpp/sugar/functions/sample.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@
2626
#ifndef Rcpp__sugar__sample_h
2727
#define Rcpp__sugar__sample_h
2828

29+
#if defined(WIN32) || defined(__WIN32) || defined(__WIN32__)
30+
#include <malloc.h>
31+
#else
2932
#include <alloca.h>
33+
#endif
3034

3135
// In order to mirror the behavior of `base::sample`
3236
// as closely as possible, this file contains adaptations

0 commit comments

Comments
 (0)