msousa@597: /* msousa@597: * matiec - a compiler for the programming languages defined in IEC 61131-3 msousa@597: * Copyright (C) 2003-2011 Mario de Sousa (msousa@fe.up.pt) msousa@597: * Copyright (C) 2007-2011 Laurent Bessard and Edouard Tisserant msousa@597: * msousa@597: * This program is free software: you can redistribute it and/or modify msousa@597: * it under the terms of the GNU General Public License as published by msousa@597: * the Free Software Foundation, either version 3 of the License, or msousa@597: * (at your option) any later version. msousa@597: * msousa@597: * This program is distributed in the hope that it will be useful, msousa@597: * but WITHOUT ANY WARRANTY; without even the implied warranty of msousa@597: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the msousa@597: * GNU General Public License for more details. msousa@597: * msousa@597: * You should have received a copy of the GNU General Public License msousa@597: * along with this program. If not, see . msousa@597: * msousa@597: * msousa@597: * This code is made available on the understanding that it will not be msousa@597: * used in safety-critical situations without a full and competent review. msousa@597: */ msousa@597: msousa@597: /* msousa@597: * An IEC 61131-3 compiler. msousa@597: * msousa@597: * Based on the msousa@597: * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10) msousa@597: * msousa@597: */ msousa@597: msousa@597: msousa@597: msousa@597: #ifndef _MAIN_HH msousa@597: #define _MAIN_HH msousa@597: msousa@597: /* Function used throughout the code --> used to report failed assertions (i.e. internal compiler errors)! */ msousa@597: msousa@597: #define ERROR error_exit(__FILE__,__LINE__) msousa@597: #define ERROR_MSG(msg, ...) error_exit(__FILE__,__LINE__, msg) msousa@597: // #define ERROR_MSG(msg, ...) error_exit(__FILE__,__LINE__, msg, __VA_ARGS__) msousa@597: msousa@597: extern void error_exit(const char *file_name, int line_no, const char *errmsg = NULL, ...); msousa@597: msousa@597: msousa@597: msousa@597: msousa@597: #endif // #ifndef _MAIN_HH