Skip to content

Commit 7e9b934

Browse files
committed
Ensure 'legacy' is called as fallback even w/ non-standard includes
1 parent 8402082 commit 7e9b934

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

inst/include/RcppArmadillo/interface/RcppArmadilloForward.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,21 @@
5050
// See version/arma.h header for the (user and/or compilation) drive selection of these defines
5151
#if defined(ARMA_SELECTED_CURRENT_VERSION)
5252

53-
// we include Armadillo 15.0.1 here
53+
// we include Armadillo 15.0.1 here -- but do it quietly
5454
//#pragma message("Using compilation with current Armadillo version.")
5555

5656
// Armadillo 15.0.1 or later
5757
#include "current/armadillo"
5858

59-
#elif defined(ARMA_SELECTED_LEGACY_VERSION)
59+
#else
60+
61+
// we use a catch-all else branch to provide for packages including this file directly
62+
// needless to say, we recommend one of the official entry-point headers
63+
#if !defined(ARMA_SELECTED_LEGACY_VERSION)
64+
#pragma message("Neither 'current' nor 'legacy' version selected. Ensure you use proper entry point headers.")
65+
#endif
6066

61-
// we include Armadillo 14.6.3 here
67+
// we include Armadillo 14.6.3 here -- but do it quietly
6268
//#pragma message("Using fallback compilation with Armadillo 14.6.3.")
6369

6470
// Armadillo has deprecation warnings (which RcppArmadillo suppressed at time to
@@ -73,10 +79,6 @@
7379

7480
#include "legacy/armadillo"
7581

76-
#else
77-
78-
#error "Neither 'current' nor 'legacy' version selected. Ensure you use proper entry point headers."
79-
8082
#endif
8183

8284
/* forward declarations */

0 commit comments

Comments
 (0)