2010-07-06 17:30:55 +02:00
|
|
|
/*
|
2023-09-22 13:22:05 +02:00
|
|
|
* Copyright © 2010-2023 Dynare Team
|
2010-07-06 17:30:55 +02:00
|
|
|
*
|
|
|
|
* This file is part of Dynare.
|
|
|
|
*
|
|
|
|
* Dynare 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 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Dynare 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
|
2021-06-09 17:33:48 +02:00
|
|
|
* along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
2010-07-06 17:30:55 +02:00
|
|
|
*/
|
|
|
|
|
2023-12-13 16:50:28 +01:00
|
|
|
#ifndef MODIFY_FOR_MEX_H
|
|
|
|
#define MODIFY_FOR_MEX_H
|
2011-02-03 18:18:03 +01:00
|
|
|
|
2023-09-22 13:28:13 +02:00
|
|
|
#include <dynblas.h>
|
|
|
|
#include <dynlapack.h>
|
2023-11-29 19:00:21 +01:00
|
|
|
#include <dynmex.h>
|
2010-05-19 15:55:47 +02:00
|
|
|
|
2023-09-22 13:28:13 +02:00
|
|
|
#define dw_malloc mxMalloc
|
|
|
|
#define dw_calloc mxCalloc
|
|
|
|
#define dw_realloc mxRealloc
|
|
|
|
#define dw_free mxFree
|
|
|
|
#define dw_exit msExit
|
2010-05-28 13:30:44 +02:00
|
|
|
|
2013-12-05 12:20:39 +01:00
|
|
|
/* Handle Ctrl-C in Matlab/Octave */
|
2023-09-22 13:28:13 +02:00
|
|
|
#ifdef MATLAB_MEX_FILE
|
|
|
|
# ifdef __cplusplus
|
|
|
|
extern "C"
|
2017-05-16 16:30:27 +02:00
|
|
|
# else
|
2023-09-22 13:28:13 +02:00
|
|
|
extern
|
2017-05-16 16:30:27 +02:00
|
|
|
# endif
|
2023-11-29 19:00:21 +01:00
|
|
|
bool
|
|
|
|
utIsInterruptPending();
|
2023-09-22 13:28:13 +02:00
|
|
|
#else
|
|
|
|
# include <octave/quit.h>
|
|
|
|
#endif
|
2013-12-05 12:20:39 +01:00
|
|
|
|
2023-09-22 13:28:13 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
#endif
|
2023-09-22 13:22:05 +02:00
|
|
|
// NB: C23 has the [[noreturn]] attribute, so this #ifdef can be removed when
|
|
|
|
// we upgrade
|
|
|
|
#ifdef __cplusplus
|
2023-11-29 19:00:21 +01:00
|
|
|
[[noreturn]]
|
2023-09-22 13:22:05 +02:00
|
|
|
#else
|
|
|
|
_Noreturn
|
|
|
|
#endif
|
2023-11-29 19:00:21 +01:00
|
|
|
void
|
|
|
|
msExit(int status);
|
2023-09-22 13:22:05 +02:00
|
|
|
|
2023-12-13 16:50:28 +01:00
|
|
|
#endif
|