
// Emacs, please make this  -*- mode: C++; -*-

// RcppArmadillo: Rcpp/Armadillo glue
//
// Copyright (C)  2025-current  Dirk Eddelbuettel
//
// This file is part of RcppArmadillo.
//
// RcppArmadillo is free software: you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// RcppArmadillo is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with RcppArmadillo.  If not, see <http://www.gnu.org/licenses/>.


// Replacement header providing the original path so that '#include <armadillo>' works
// with the R package -- but it is recommended to include only the RcppArmadillo header
//
// Once the Armadillo 15.0.* / 14.6.3 transition is done this file will fall back to
// the default Armadillo header


#ifndef RcppArmadillo__armadillo__h
#define RcppArmadillo__armadillo__h

// See version/arma.h header for the (user and/or compilation) drive selection of these defines
#if defined(ARMA_SELECTED_CURRENT_VERSION)

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

    // Armadillo 15.0.1 or later
    #include "current/armadillo"

#else

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

    // Armadillo has deprecation warnings (which RcppArmadillo suppressed at time to
    // minimise issies at CRAN).  Should your package display any, and you decide
    // _not_ to fix the root causes (see RcppArmadillo GitHub Issues #391 and #402
    // for details) then defining the following macro will help. You can add a
    // #define in your source code before including the RcppArmadillo header, or add
    // a -DARMA_IGNORE_DEPRECATED_MARKER to the PKG_CPPFLAGS in src/Makevars.
    //
    // Renabling globally again for Armadillo 14.6.* as too many packages trigger this
    #define ARMA_IGNORE_DEPRECATED_MARKER

    #include "legacy/armadillo"

#endif

#endif
