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/>.
|
||||
*/
|
||||
|
||||
#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 "DynamicModelCaller.hh"
|
||||
|
@ -34,7 +25,11 @@
|
|||
|
||||
std::string DynamicModelCaller::error_msg;
|
||||
|
||||
#if defined(_WIN32) || defined(__CYGWIN32__)
|
||||
HINSTANCE DynamicModelDllCaller::dynamic_mex{nullptr};
|
||||
#else
|
||||
void *DynamicModelDllCaller::dynamic_mex{nullptr};
|
||||
#endif
|
||||
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};
|
||||
|
||||
|
|
|
@ -21,6 +21,15 @@
|
|||
#include <memory>
|
||||
#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
|
||||
{
|
||||
public:
|
||||
|
@ -39,7 +48,11 @@ public:
|
|||
class DynamicModelDllCaller : public DynamicModelCaller
|
||||
{
|
||||
private:
|
||||
#if defined(_WIN32) || defined(__CYGWIN32__)
|
||||
static HINSTANCE dynamic_mex;
|
||||
#else
|
||||
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_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;
|
||||
|
|
Loading…
Reference in New Issue