perfect_foresight_problem MEX: fix compilation under Windows
parent
7e274d8234
commit
7347554db5
|
@ -17,15 +17,6 @@
|
||||||
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(__CYGWIN32__)
|
|
||||||
# ifndef NOMINMAX
|
|
||||||
# define NOMINMAX // Do not define "min" and "max" macros
|
|
||||||
# endif
|
|
||||||
# include <windows.h>
|
|
||||||
#else
|
|
||||||
# include <dlfcn.h> // unix/linux DLL (.so) handling routines
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <dynmex.h>
|
#include <dynmex.h>
|
||||||
|
|
||||||
#include "DynamicModelCaller.hh"
|
#include "DynamicModelCaller.hh"
|
||||||
|
@ -34,7 +25,11 @@
|
||||||
|
|
||||||
std::string DynamicModelCaller::error_msg;
|
std::string DynamicModelCaller::error_msg;
|
||||||
|
|
||||||
|
#if defined(_WIN32) || defined(__CYGWIN32__)
|
||||||
|
HINSTANCE DynamicModelDllCaller::dynamic_mex{nullptr};
|
||||||
|
#else
|
||||||
void *DynamicModelDllCaller::dynamic_mex{nullptr};
|
void *DynamicModelDllCaller::dynamic_mex{nullptr};
|
||||||
|
#endif
|
||||||
DynamicModelDllCaller::dynamic_tt_fct DynamicModelDllCaller::residual_tt_fct{nullptr}, DynamicModelDllCaller::g1_tt_fct{nullptr};
|
DynamicModelDllCaller::dynamic_tt_fct DynamicModelDllCaller::residual_tt_fct{nullptr}, DynamicModelDllCaller::g1_tt_fct{nullptr};
|
||||||
DynamicModelDllCaller::dynamic_deriv_fct DynamicModelDllCaller::residual_fct{nullptr}, DynamicModelDllCaller::g1_fct{nullptr};
|
DynamicModelDllCaller::dynamic_deriv_fct DynamicModelDllCaller::residual_fct{nullptr}, DynamicModelDllCaller::g1_fct{nullptr};
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,15 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
|
#if defined(_WIN32) || defined(__CYGWIN32__)
|
||||||
|
# ifndef NOMINMAX
|
||||||
|
# define NOMINMAX // Do not define "min" and "max" macros
|
||||||
|
# endif
|
||||||
|
# include <windows.h>
|
||||||
|
#else
|
||||||
|
# include <dlfcn.h> // unix/linux DLL (.so) handling routines
|
||||||
|
#endif
|
||||||
|
|
||||||
class DynamicModelCaller
|
class DynamicModelCaller
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -39,7 +48,11 @@ public:
|
||||||
class DynamicModelDllCaller : public DynamicModelCaller
|
class DynamicModelDllCaller : public DynamicModelCaller
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
#if defined(_WIN32) || defined(__CYGWIN32__)
|
||||||
|
static HINSTANCE dynamic_mex;
|
||||||
|
#else
|
||||||
static void *dynamic_mex;
|
static void *dynamic_mex;
|
||||||
|
#endif
|
||||||
using dynamic_tt_fct = void (*)(const double *y, const double *x, int nb_row_x, const double *params, const double *steady_state, int it_, double *T);
|
using dynamic_tt_fct = void (*)(const double *y, const double *x, int nb_row_x, const double *params, const double *steady_state, int it_, double *T);
|
||||||
using dynamic_deriv_fct = void (*) (const double *y, const double *x, int nb_row_x, const double *params, const double *steady_state, int it_, const double *T, double *deriv);
|
using dynamic_deriv_fct = void (*) (const double *y, const double *x, int nb_row_x, const double *params, const double *steady_state, int it_, const double *T, double *deriv);
|
||||||
static dynamic_tt_fct residual_tt_fct, g1_tt_fct;
|
static dynamic_tt_fct residual_tt_fct, g1_tt_fct;
|
||||||
|
|
Loading…
Reference in New Issue