Branch data Line data Source code
1 : : /* do not edit automatically generated by mc from M2Size. */
2 : : /* M2Size.mod exports the standard function SIZE.
3 : :
4 : : Copyright (C) 2003-2025 Free Software Foundation, Inc.
5 : : Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
6 : :
7 : : This file is part of GNU Modula-2.
8 : :
9 : : GNU Modula-2 is free software; you can redistribute it and/or modify
10 : : it under the terms of the GNU General Public License as published by
11 : : the Free Software Foundation; either version 3, or (at your option)
12 : : any later version.
13 : :
14 : : GNU Modula-2 is distributed in the hope that it will be useful, but
15 : : WITHOUT ANY WARRANTY; without even the implied warranty of
16 : : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 : : General Public License for more details.
18 : :
19 : : You should have received a copy of the GNU General Public License
20 : : along with GNU Modula-2; see the file COPYING3. If not see
21 : : <http://www.gnu.org/licenses/>. */
22 : :
23 : : #include "config.h"
24 : : #include "system.h"
25 : : #include "gcc-consolidation.h"
26 : :
27 : : #include <stdbool.h>
28 : : # if !defined (PROC_D)
29 : : # define PROC_D
30 : : typedef void (*PROC_t) (void);
31 : : typedef struct { PROC_t proc; } PROC;
32 : : # endif
33 : :
34 : : #define _M2Size_C
35 : :
36 : : #include "GM2Size.h"
37 : : # include "GNameKey.h"
38 : : # include "GM2Base.h"
39 : : # include "GM2LexBuf.h"
40 : : # include "GSymbolTable.h"
41 : :
42 : :
43 : : /*
44 : : MakeSize - creates and declares the standard function SIZE.
45 : : */
46 : :
47 : : extern "C" void M2Size_MakeSize (void);
48 : :
49 : :
50 : : /*
51 : : MakeSize - creates and declares the standard function SIZE.
52 : : */
53 : :
54 : 30434 : extern "C" void M2Size_MakeSize (void)
55 : : {
56 : 30434 : if (M2Size_Size == SymbolTable_NulSym)
57 : : {
58 : : /* Function */
59 : 15260 : M2Size_Size = SymbolTable_MakeProcedure (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) "SIZE", 4));
60 : : /* ZType */
61 : 15260 : SymbolTable_PutFunction (M2LexBuf_BuiltinTokenNo, M2Size_Size, SymbolTable_DefProcedure, M2Base_ZType);
62 : : }
63 : : else
64 : : {
65 : 15174 : SymbolTable_AddSymToModuleScope (SymbolTable_GetCurrentScope (), M2Size_Size);
66 : : }
67 : 30434 : }
68 : :
69 : 0 : extern "C" void _M2_M2Size_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[], __attribute__((unused)) char *envp[])
70 : : {
71 : 0 : M2Size_Size = SymbolTable_NulSym;
72 : 0 : }
73 : :
74 : 0 : extern "C" void _M2_M2Size_fini (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[], __attribute__((unused)) char *envp[])
75 : : {
76 : 0 : }
|