Add file missing from previous commit.
authorMario de Sousa <msousa@fe.up.pt>
Sat, 16 Jun 2012 07:41:30 +0100
changeset 597 7326a0658104
parent 596 4efb11e44065
child 598 0b1ee7e7123b
Add file missing from previous commit.
main.hh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.hh	Sat Jun 16 07:41:30 2012 +0100
@@ -0,0 +1,48 @@
+/*
+ *  matiec - a compiler for the programming languages defined in IEC 61131-3
+ *  Copyright (C) 2003-2011  Mario de Sousa (msousa@fe.up.pt)
+ *  Copyright (C) 2007-2011  Laurent Bessard and Edouard Tisserant
+ *
+ *  This program 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.
+ *
+ *  This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+
+#ifndef _MAIN_HH
+#define _MAIN_HH
+
+ /* Function used throughout the code --> used to report failed assertions (i.e. internal compiler errors)! */
+
+#define ERROR               error_exit(__FILE__,__LINE__)
+#define ERROR_MSG(msg, ...) error_exit(__FILE__,__LINE__, msg)
+// #define ERROR_MSG(msg, ...) error_exit(__FILE__,__LINE__, msg, __VA_ARGS__)
+
+extern void error_exit(const char *file_name, int line_no, const char *errmsg = NULL, ...);
+
+
+
+
+#endif // #ifndef _MAIN_HH
\ No newline at end of file