libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / m2 / mc-boot / GmcDebug.cc
blob0085384f2c98262114519c041d6e43cf589d5039
1 /* do not edit automatically generated by mc from mcDebug. */
2 /* This file is part of GNU Modula-2.
4 GNU Modula-2 is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 3, or (at your option) any later
7 version.
9 GNU Modula-2 is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 for more details.
14 You should have received a copy of the GNU General Public License
15 along with GCC; see the file COPYING3. If not see
16 <http://www.gnu.org/licenses/>. */
18 #include "config.h"
19 #include "system.h"
20 #include <stdbool.h>
21 # if !defined (PROC_D)
22 # define PROC_D
23 typedef void (*PROC_t) (void);
24 typedef struct { PROC_t proc; } PROC;
25 # endif
27 #define _mcDebug_C
29 #include "GmcDebug.h"
30 # include "GStrIO.h"
31 # include "GmcOptions.h"
32 # include "GmcError.h"
36 assert - tests the boolean, q. If false then an error is reported
37 and the execution is terminated.
40 extern "C" void mcDebug_assert (bool q);
43 writeDebug - only writes a string if internal debugging is on.
46 extern "C" void mcDebug_writeDebug (const char *a_, unsigned int _a_high);
50 assert - tests the boolean, q. If false then an error is reported
51 and the execution is terminated.
54 extern "C" void mcDebug_assert (bool q)
56 if (! q)
58 mcError_internalError ((const char *) "assert failed", 13, (const char *) "../../gcc/m2/mc/mcDebug.mod", 27, 35);
64 writeDebug - only writes a string if internal debugging is on.
67 extern "C" void mcDebug_writeDebug (const char *a_, unsigned int _a_high)
69 char a[_a_high+1];
71 /* make a local copy of each unbounded array. */
72 memcpy (a, a_, _a_high+1);
74 if (mcOptions_getInternalDebugging ())
76 StrIO_WriteString ((const char *) a, _a_high);
77 StrIO_WriteLn ();
81 extern "C" void _M2_mcDebug_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[], __attribute__((unused)) char *envp[])
85 extern "C" void _M2_mcDebug_fini (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[], __attribute__((unused)) char *envp[])