| 1 |
/* do not edit automatically generated by mc from mcDebug. */ |
| 2 |
/* This file is part of GNU Modula-2. |
| 3 |
|
| 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. |
| 8 |
|
| 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. |
| 13 |
|
| 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/>. */ |
| 17 |
|
| 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 |
| 26 |
|
| 27 |
#define _mcDebug_C |
| 28 |
|
| 29 |
#include "GmcDebug.h" |
| 30 |
# include "GStrIO.h" |
| 31 |
# include "GmcOptions.h" |
| 32 |
# include "GmcError.h" |
| 33 |
|
| 34 |
|
| 35 |
/* |
| 36 |
assert - tests the boolean, q. If false then an error is reported |
| 37 |
and the execution is terminated. |
| 38 |
*/ |
| 39 |
|
| 40 |
extern "C" void mcDebug_assert (bool q); |
| 41 |
|
| 42 |
/* |
| 43 |
writeDebug - only writes a string if internal debugging is on. |
| 44 |
*/ |
| 45 |
|
| 46 |
extern "C" void mcDebug_writeDebug (const char *a_, unsigned int _a_high); |
| 47 |
|
| 48 |
|
| 49 |
/* |
| 50 |
assert - tests the boolean, q. If false then an error is reported |
| 51 |
and the execution is terminated. |
| 52 |
*/ |
| 53 |
|
| 54 |
extern "C" void mcDebug_assert (bool q) |
| 55 |
{ |
| 56 |
if (! q) |
| 57 |
{ |
| 58 |
mcError_internalError ((const char *) "assert failed", 13, (const char *) "../../gcc/m2/mc/mcDebug.mod", 27, 35); |
| 59 |
} |
| 60 |
} |
| 61 |
|
| 62 |
|
| 63 |
/* |
| 64 |
writeDebug - only writes a string if internal debugging is on. |
| 65 |
*/ |
| 66 |
|
| 67 |
extern "C" void mcDebug_writeDebug (const char *a_, unsigned int _a_high) |
| 68 |
{ |
| 69 |
char a[_a_high+1]; |
| 70 |
|
| 71 |
/* make a local copy of each unbounded array. */ |
| 72 |
memcpy (a, a_, _a_high+1); |
| 73 |
|
| 74 |
if (mcOptions_getInternalDebugging ()) |
| 75 |
{ |
| 76 |
StrIO_WriteString ((const char *) a, _a_high); |
| 77 |
StrIO_WriteLn (); |
| 78 |
} |
| 79 |
} |
| 80 |
|
| 81 |
extern "C" void _M2_mcDebug_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[], __attribute__((unused)) char *envp[]) |
| 82 |
{ |
| 83 |
} |
| 84 |
|
| 85 |
extern "C" void _M2_mcDebug_fini (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[], __attribute__((unused)) char *envp[]) |
| 86 |
{ |
| 87 |
} |