Fix whitespace snafu in tc-riscv.c
[binutils-gdb.git] / sim / common / sim-inline.h
blobe5905846d1ff750e333fc0d1f8c1451a0ede09a0
1 /* The common simulator framework for GDB, the GNU Debugger.
3 Copyright 2002-2023 Free Software Foundation, Inc.
5 Contributed by Andrew Cagney and Red Hat.
7 This file is part of GDB.
9 This program 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 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 #ifndef SIM_INLINE_H
24 #define SIM_INLINE_H
26 #include "ansidecl.h"
28 /* INLINE CODE SELECTION:
30 GCC -O3 attempts to inline any function or procedure in scope. The
31 options below facilitate finer grained control over what is and
32 what is not inlined. In particular, it allows the selection of
33 modules for inlining. Doing this allows the compiler to both
34 eliminate the overhead of function calls and (as a consequence)
35 also eliminate further dead code.
37 On a CISC (x86) I've found that I can achieve an order of magnitude
38 speed improvement (x3-x5). In the case of RISC (sparc) while the
39 performance gain isn't as great it is still significant.
41 Each module is controled by the macro <module>_INLINE which can
42 have the values described below
44 0 (ZERO)
46 Do not inline any thing for the given module
48 The following bit fields values can be combined:
50 H_REVEALS_MODULE:
51 C_REVEALS_MODULE:
53 Include the C file for the module into the file being
54 compiled. The actual inlining is controlled separatly.
56 While of no apparent benefit, this makes it possible for the
57 included module, when compiled, to inline its calls to what
58 would otherwize be external functions.
60 {C_,H_} Determines where the module is inlined. A
61 H_REVEALS_MODULE will be included everywhere.
63 INLINE_GLOBALS:
65 Make external functions within the module `inline'. Thus if
66 the module is included into a file being compiled, calls to
67 the included modules funtions can be eliminated. INLINE_MODULE
68 implies REVEAL_MODULE.
70 INLINE_LOCALS:
72 Make internal (static) functions within the module `inline'.
75 CODING STYLE:
77 The inline ability is enabled by specifying every data and function
78 declaration and definition using one of the following methods:
81 GLOBAL INLINE FUNCTIONS:
83 Such functions are small and used heavily. Inlining them
84 will eliminate an unnecessary function call overhead.
86 .h: INLINE_OURPKG (void) ourpkg_func
87 (int x,
88 int y);
90 .c: INLINE_OURPKG (void)
91 ourpkg_func (int x,
92 int y)
94 ...
98 GLOBAL INLINE VARIABLES:
100 This doesn't make much sense.
103 GLOBAL NON-INLINE (EXTERN) FUNCTIONS AND VARIABLES:
105 These include functions with varargs parameters. It can
106 also include large rarely used functions that contribute
107 little when inlined.
109 .h: extern int ourpkg_print
110 (char *fmt, ...);
111 extern int a_global_variable;
113 .c: #if EXTERN_OURPKG_P
115 ourpkg_print (char *fmt,
116 ...)
120 #endif
121 #if EXTERN_OURPKG_P
122 int a_global_variable = 1;
123 #endif
126 LOCAL (STATIC) FUNCTIONS:
128 These can either be marked inline or just static static vis:
130 .h: STATIC_INLINE_OURPKG (int) ourpkg_staticf (void);
131 .c: STATIC_INLINE_OURPKG (int)
132 ourpkg_staticf (void)
137 .h: STATIC_OURPKG (int) ourpkg_staticf (void);
138 .c: STATIC_OURPKG (int)
139 ourpkg_staticf (void)
145 All .h files:
148 All modules must wrap their .h code in the following:
150 #ifndef OURPKG_H
151 #define OURPKG_H
152 ... code proper ...
153 #endif
155 In addition, modules that want to allow global inlining must
156 include the lines (below) at the end of the .h file. (FIXME:
157 Shouldn't be needed).
159 #if H_REVEALS_MODULE_P (OURPKG_INLINE)
160 #include "ourpkg.c"
161 #endif
164 All .c files:
166 All modules must wrap their .c code in the following
168 #ifndef OURPKG_C
169 #define OURPKG_C
170 ... code proper ...
171 #endif
174 NOW IT WORKS:
178 Since no inlining is defined. All macro's get standard defaults
179 (extern, static, ...).
183 H_REVEALS_MODULE (alt includes our):
186 altprog.c defines ALTPROG_C and then includes sim-inline.h.
188 In sim-inline.h the expression `` H_REVEALS_MODULE_P
189 (OURPROG_INLINE) && ! defined (OURPROG_C) && REVEAL_MODULE_P
190 (OURPROG_INLINE) '' is TRUE so it defines *_OURPROG as static
191 and EXTERN_OURPROG_P as FALSE.
193 altprog.c includes ourprog.h.
195 In ourprog.h the expression ``H_REVEALS_MODULE_P
196 (OURPROG_INLINE)'' is TRUE so it includes ourprog.c.
198 Consequently, all the code in ourprog.c is visible and static in
199 the file altprog.c
203 H_REVEALS_MODULE (our includes our):
206 ourprog.c defines OURPROG_C and then includes sim-inline.h.
208 In sim-inline.h the term `` ! defined (OURPROG_C) '' is FALSE so
209 it defines *_OURPROG as non-static and EXTERN_OURPROG_P as TRUE.
211 ourprog.c includes ourprog.h.
213 In ourprog.h the expression ``H_REVEALS_MODULE_P
214 (OURPROG_INLINE)'' is true so it includes ourprog.c.
216 In ourprog.c (second include) the expression defined (OURPROG_C)
217 and so the body is not re-included.
219 Consequently, ourprog.o will contain a non-static copy of all
220 the exported symbols.
224 C_REVEALS_MODULE (alt includes our):
227 altprog.c defines ALTPROG_C and then includes sim-inline.c
229 sim-inline.c defines C_INLINE_C and then includes sim-inline.h
231 In sim-inline.h the expression `` defined (SIM_INLINE) && !
232 defined (OURPROG_C) && REVEAL_MODULE_P (OURPROG_INLINE) '' is
233 true so it defines *_OURPROG as static and EXTERN_OURPROG_P as
234 FALSE.
236 In sim-inline.c the expression ``C_REVEALS_MODULE_P
237 (OURPROG_INLINE)'' is true so it includes ourprog.c.
239 Consequently, all the code in ourprog.c is visible and static in
240 the file altprog.c.
244 C_REVEALS_MODULE (our includes our):
247 ourprog.c defines OURPROG_C and then includes sim-inline.c
249 sim-inline.c defines C_INLINE_C and then includes sim-inline.h
251 In sim-inline.h the term `` ! defined (OURPROG_C) '' is FALSE
252 so it defines *_OURPROG as non-static and EXTERN_OURPROG_P as
253 TRUE.
255 Consequently, ourprog.o will contain a non-static copy of all
256 the exported symbols.
260 REALITY CHECK:
262 This is not for the faint hearted. I've seen GCC get up to 500mb
263 trying to compile what this can create. */
265 #define H_REVEALS_MODULE 1
266 #define C_REVEALS_MODULE 2
267 #define INLINE_GLOBALS 4
268 #define INLINE_LOCALS 8
270 #define ALL_H_INLINE (H_REVEALS_MODULE | INLINE_GLOBALS | INLINE_LOCALS)
271 #define ALL_C_INLINE (C_REVEALS_MODULE | INLINE_GLOBALS | INLINE_LOCALS)
274 /* Default macro to simplify control several of key the inlines */
276 #ifndef DEFAULT_INLINE
277 #define DEFAULT_INLINE INLINE_LOCALS
278 #endif
280 #define REVEAL_MODULE_P(X) (X & (H_REVEALS_MODULE | C_REVEALS_MODULE))
281 #define H_REVEALS_MODULE_P(X) ((X & H_REVEALS_MODULE))
282 #define C_REVEALS_MODULE_P(X) ((X & C_REVEALS_MODULE))
285 #ifndef HAVE_INLINE
286 #ifdef __GNUC__
287 #define HAVE_INLINE
288 #endif
289 #endif
292 /* Your compilers inline prefix */
294 #ifndef INLINE
295 #if defined (__GNUC__) && defined (__OPTIMIZE__)
296 #define INLINE __inline__
297 #else
298 #define INLINE /*inline*/
299 #endif
300 #endif
302 /* ??? Temporary, pending decision to always use extern inline and do a vast
303 cleanup of inline support. */
304 #ifndef INLINE2
305 #if defined (__GNUC_GNU_INLINE__) || defined (__GNUC_STDC_INLINE__)
306 #define INLINE2 __inline__ __attribute__ ((__gnu_inline__))
307 #elif defined (__GNUC__)
308 #define INLINE2 __inline__
309 #else
310 #define INLINE2 /*inline*/
311 #endif
312 #endif
315 /* Your compiler's static inline prefix */
317 #ifndef STATIC_INLINE
318 #define STATIC_INLINE static INLINE
319 #endif
322 /* Your compiler's extern inline prefix */
324 #ifndef EXTERN_INLINE
325 #define EXTERN_INLINE extern INLINE2
326 #endif
329 /* Your compilers's unused reserved word */
331 #if !defined (UNUSED)
332 #define UNUSED ATTRIBUTE_UNUSED
333 #endif
339 /* sim_arange */
341 #if !defined (SIM_ARANGE_INLINE) && (DEFAULT_INLINE)
342 # define SIM_ARANGE_INLINE (ALL_H_INLINE)
343 #endif
345 #if ((H_REVEALS_MODULE_P (SIM_ARANGE_INLINE) || defined (SIM_INLINE_C)) \
346 && !defined (SIM_ARANGE_C) \
347 && (REVEAL_MODULE_P (SIM_ARANGE_INLINE)))
348 # if (SIM_ARANGE_INLINE & INLINE_GLOBALS)
349 # define INLINE_SIM_ARANGE(TYPE) static INLINE UNUSED TYPE
350 # define EXTERN_SIM_ARANGE_P 0
351 # else
352 # define INLINE_SIM_ARANGE(TYPE) static UNUSED TYPE
353 # define EXTERN_SIM_ARANGE_P 0
354 # endif
355 #else
356 # define INLINE_SIM_ARANGE(TYPE) TYPE
357 # define EXTERN_SIM_ARANGE_P 1
358 #endif
360 #if (SIM_ARANGE_INLINE & INLINE_LOCALS)
361 # define STATIC_INLINE_SIM_ARANGE(TYPE) static INLINE TYPE
362 #else
363 # define STATIC_INLINE_SIM_ARANGE(TYPE) static TYPE
364 #endif
366 #define STATIC_SIM_ARANGE(TYPE) static TYPE
370 /* *****
371 sim-bits and sim-endian are treated differently from the rest
372 of the modules below. Their default value is ALL_H_INLINE.
373 The rest are ALL_C_INLINE. Don't blink, you'll miss it!
374 *****
377 /* sim-bits */
379 #if !defined (SIM_BITS_INLINE) && (DEFAULT_INLINE)
380 # define SIM_BITS_INLINE (ALL_H_INLINE)
381 #endif
383 #if ((H_REVEALS_MODULE_P (SIM_BITS_INLINE) || defined (SIM_INLINE_C)) \
384 && !defined (SIM_BITS_C) \
385 && (REVEAL_MODULE_P (SIM_BITS_INLINE)))
386 # if (SIM_BITS_INLINE & INLINE_GLOBALS)
387 # define INLINE_SIM_BITS(TYPE) static INLINE UNUSED TYPE
388 # define EXTERN_SIM_BITS_P 0
389 # else
390 # define INLINE_SIM_BITS(TYPE) static UNUSED TYPE
391 # define EXTERN_SIM_BITS_P 0
392 # endif
393 #else
394 # define INLINE_SIM_BITS(TYPE) TYPE
395 # define EXTERN_SIM_BITS_P 1
396 #endif
398 #if (SIM_BITS_INLINE & INLINE_LOCALS)
399 # define STATIC_INLINE_SIM_BITS(TYPE) static INLINE TYPE
400 #else
401 # define STATIC_INLINE_SIM_BITS(TYPE) static TYPE
402 #endif
404 #define STATIC_SIM_BITS(TYPE) static TYPE
408 /* sim-core */
410 #if !defined (SIM_CORE_INLINE) && (DEFAULT_INLINE)
411 # define SIM_CORE_INLINE ALL_C_INLINE
412 #endif
414 #if ((H_REVEALS_MODULE_P (SIM_CORE_INLINE) || defined (SIM_INLINE_C)) \
415 && !defined (SIM_CORE_C) \
416 && (REVEAL_MODULE_P (SIM_CORE_INLINE)))
417 # if (SIM_CORE_INLINE & INLINE_GLOBALS)
418 # define INLINE_SIM_CORE(TYPE) static INLINE UNUSED TYPE
419 # define EXTERN_SIM_CORE_P 0
420 #else
421 # define INLINE_SIM_CORE(TYPE) static UNUSED TYPE
422 # define EXTERN_SIM_CORE_P 0
423 #endif
424 #else
425 # define INLINE_SIM_CORE(TYPE) TYPE
426 # define EXTERN_SIM_CORE_P 1
427 #endif
429 #if (SIM_CORE_INLINE & INLINE_LOCALS)
430 # define STATIC_INLINE_SIM_CORE(TYPE) static INLINE TYPE
431 #else
432 # define STATIC_INLINE_SIM_CORE(TYPE) static TYPE
433 #endif
435 #define STATIC_SIM_CORE(TYPE) static TYPE
439 /* sim-endian */
441 #if !defined (SIM_ENDIAN_INLINE) && (DEFAULT_INLINE)
442 # define SIM_ENDIAN_INLINE ALL_H_INLINE
443 #endif
445 #if ((H_REVEALS_MODULE_P (SIM_ENDIAN_INLINE) || defined (SIM_INLINE_C)) \
446 && !defined (SIM_ENDIAN_C) \
447 && (REVEAL_MODULE_P (SIM_ENDIAN_INLINE)))
448 # if (SIM_ENDIAN_INLINE & INLINE_GLOBALS)
449 # define INLINE_SIM_ENDIAN(TYPE) static INLINE UNUSED TYPE
450 # define EXTERN_SIM_ENDIAN_P 0
451 # else
452 # define INLINE_SIM_ENDIAN(TYPE) static UNUSED TYPE
453 # define EXTERN_SIM_ENDIAN_P 0
454 # endif
455 #else
456 # define INLINE_SIM_ENDIAN(TYPE) TYPE
457 # define EXTERN_SIM_ENDIAN_P 1
458 #endif
460 #if (SIM_ENDIAN_INLINE & INLINE_LOCALS)
461 # define STATIC_INLINE_SIM_ENDIAN(TYPE) static INLINE TYPE
462 #else
463 # define STATIC_INLINE_SIM_ENDIAN(TYPE) static TYPE
464 #endif
466 #define STATIC_SIM_ENDIAN(TYPE) static TYPE
470 /* sim-events */
472 #if !defined (SIM_EVENTS_INLINE) && (DEFAULT_INLINE)
473 # define SIM_EVENTS_INLINE ALL_C_INLINE
474 #endif
476 #if ((H_REVEALS_MODULE_P (SIM_EVENTS_INLINE) || defined (SIM_INLINE_C)) \
477 && !defined (SIM_EVENTS_C) \
478 && (REVEAL_MODULE_P (SIM_EVENTS_INLINE)))
479 # if (SIM_EVENTS_INLINE & INLINE_GLOBALS)
480 # define INLINE_SIM_EVENTS(TYPE) static INLINE UNUSED TYPE
481 # define EXTERN_SIM_EVENTS_P 0
482 # else
483 # define INLINE_SIM_EVENTS(TYPE) static UNUSED TYPE
484 # define EXTERN_SIM_EVENTS_P 0
485 # endif
486 #else
487 # define INLINE_SIM_EVENTS(TYPE) TYPE
488 # define EXTERN_SIM_EVENTS_P 1
489 #endif
491 #if (SIM_EVENTS_INLINE & INLINE_LOCALS)
492 # define STATIC_INLINE_SIM_EVENTS(TYPE) static INLINE TYPE
493 #else
494 # define STATIC_INLINE_SIM_EVENTS(TYPE) static TYPE
495 #endif
497 #define STATIC_SIM_EVENTS(TYPE) static TYPE
501 /* sim-fpu */
503 #if !defined (SIM_FPU_INLINE) && (DEFAULT_INLINE)
504 # define SIM_FPU_INLINE ALL_C_INLINE
505 #endif
507 #if ((H_REVEALS_MODULE_P (SIM_FPU_INLINE) || defined (SIM_INLINE_C)) \
508 && !defined (SIM_FPU_C) \
509 && (REVEAL_MODULE_P (SIM_FPU_INLINE)))
510 # if (SIM_FPU_INLINE & INLINE_GLOBALS)
511 # define INLINE_SIM_FPU(TYPE) static INLINE UNUSED TYPE
512 # define EXTERN_SIM_FPU_P 0
513 # else
514 # define INLINE_SIM_FPU(TYPE) static UNUSED TYPE
515 # define EXTERN_SIM_FPU_P 0
516 # endif
517 #else
518 # define INLINE_SIM_FPU(TYPE) TYPE
519 # define EXTERN_SIM_FPU_P 1
520 #endif
522 #if (SIM_FPU_INLINE & INLINE_LOCALS)
523 # define STATIC_INLINE_SIM_FPU(TYPE) static INLINE TYPE
524 #else
525 # define STATIC_INLINE_SIM_FPU(TYPE) static TYPE
526 #endif
528 #define STATIC_SIM_FPU(TYPE) static TYPE
532 /* sim-types */
534 #if ((H_REVEALS_MODULE_P (SIM_TYPES_INLINE) || defined (SIM_INLINE_C)) \
535 && !defined (SIM_TYPES_C) \
536 && (REVEAL_MODULE_P (SIM_TYPES_INLINE)))
537 # if (SIM_TYPES_INLINE & INLINE_GLOBALS)
538 # define INLINE_SIM_TYPES(TYPE) static INLINE UNUSED TYPE
539 # define EXTERN_SIM_TYPES_P 0
540 # else
541 # define INLINE_SIM_TYPES(TYPE) static UNUSED TYPE
542 # define EXTERN_SIM_TYPES_P 0
543 # endif
544 #else
545 # define INLINE_SIM_TYPES(TYPE) TYPE
546 # define EXTERN_SIM_TYPES_P 1
547 #endif
549 #if (SIM_TYPES_INLINE & INLINE_LOCALS)
550 # define STATIC_INLINE_SIM_TYPES(TYPE) static INLINE TYPE
551 #else
552 # define STATIC_INLINE_SIM_TYPES(TYPE) static TYPE
553 #endif
555 #define STATIC_SIM_TYPES(TYPE) static TYPE
559 /* sim_main */
561 #if !defined (SIM_MAIN_INLINE) && (DEFAULT_INLINE)
562 # define SIM_MAIN_INLINE (ALL_C_INLINE)
563 #endif
565 #if ((H_REVEALS_MODULE_P (SIM_MAIN_INLINE) || defined (SIM_INLINE_C)) \
566 && !defined (SIM_MAIN_C) \
567 && (REVEAL_MODULE_P (SIM_MAIN_INLINE)))
568 # if (SIM_MAIN_INLINE & INLINE_GLOBALS)
569 # define INLINE_SIM_MAIN(TYPE) static INLINE UNUSED TYPE
570 # define EXTERN_SIM_MAIN_P 0
571 # else
572 # define INLINE_SIM_MAIN(TYPE) static UNUSED TYPE
573 # define EXTERN_SIM_MAIN_P 0
574 # endif
575 #else
576 # define INLINE_SIM_MAIN(TYPE) TYPE
577 # define EXTERN_SIM_MAIN_P 1
578 #endif
580 #if (SIM_MAIN_INLINE & INLINE_LOCALS)
581 # define STATIC_INLINE_SIM_MAIN(TYPE) static INLINE TYPE
582 #else
583 # define STATIC_INLINE_SIM_MAIN(TYPE) static TYPE
584 #endif
586 #define STATIC_SIM_MAIN(TYPE) static TYPE
588 /* engine */
590 #if ((H_REVEALS_MODULE_P (ENGINE_INLINE) || defined (SIM_INLINE_C)) \
591 && !defined (ENGINE_C) \
592 && (REVEAL_MODULE_P (ENGINE_INLINE)))
593 # if (ENGINE_INLINE & INLINE_GLOBALS)
594 # define INLINE_ENGINE(TYPE) static INLINE UNUSED TYPE
595 # define EXTERN_ENGINE_P 0
596 # else
597 # define INLINE_ENGINE(TYPE) static UNUSED TYPE
598 # define EXTERN_ENGINE_P 0
599 # endif
600 #else
601 # define INLINE_ENGINE(TYPE) TYPE
602 # define EXTERN_ENGINE_P 1
603 #endif
605 #if (ENGINE_INLINE & INLINE_LOCALS)
606 # define STATIC_INLINE_ENGINE(TYPE) static INLINE TYPE
607 #else
608 # define STATIC_INLINE_ENGINE(TYPE) static TYPE
609 #endif
611 #define STATIC_ENGINE(TYPE) static TYPE
615 /* icache */
617 #if ((H_REVEALS_MODULE_P (ICACHE_INLINE) || defined (SIM_INLINE_C)) \
618 && !defined (ICACHE_C) \
619 && (REVEAL_MODULE_P (ICACHE_INLINE)))
620 # if (ICACHE_INLINE & INLINE_GLOBALS)
621 # define INLINE_ICACHE(TYPE) static INLINE UNUSED TYPE
622 # define EXTERN_ICACHE_P 0
623 #else
624 # define INLINE_ICACHE(TYPE) static UNUSED TYPE
625 # define EXTERN_ICACHE_P 0
626 #endif
627 #else
628 # define INLINE_ICACHE(TYPE) TYPE
629 # define EXTERN_ICACHE_P 1
630 #endif
632 #if (ICACHE_INLINE & INLINE_LOCALS)
633 # define STATIC_INLINE_ICACHE(TYPE) static INLINE TYPE
634 #else
635 # define STATIC_INLINE_ICACHE(TYPE) static TYPE
636 #endif
638 #define STATIC_ICACHE(TYPE) static TYPE
642 /* idecode */
644 #if ((H_REVEALS_MODULE_P (IDECODE_INLINE) || defined (SIM_INLINE_C)) \
645 && !defined (IDECODE_C) \
646 && (REVEAL_MODULE_P (IDECODE_INLINE)))
647 # if (IDECODE_INLINE & INLINE_GLOBALS)
648 # define INLINE_IDECODE(TYPE) static INLINE UNUSED TYPE
649 # define EXTERN_IDECODE_P 0
650 #else
651 # define INLINE_IDECODE(TYPE) static UNUSED TYPE
652 # define EXTERN_IDECODE_P 0
653 #endif
654 #else
655 # define INLINE_IDECODE(TYPE) TYPE
656 # define EXTERN_IDECODE_P 1
657 #endif
659 #if (IDECODE_INLINE & INLINE_LOCALS)
660 # define STATIC_INLINE_IDECODE(TYPE) static INLINE TYPE
661 #else
662 # define STATIC_INLINE_IDECODE(TYPE) static TYPE
663 #endif
665 #define STATIC_IDECODE(TYPE) static TYPE
669 /* semantics */
671 #if ((H_REVEALS_MODULE_P (SEMANTICS_INLINE) || defined (SIM_INLINE_C)) \
672 && !defined (SEMANTICS_C) \
673 && (REVEAL_MODULE_P (SEMANTICS_INLINE)))
674 # if (SEMANTICS_INLINE & INLINE_GLOBALS)
675 # define INLINE_SEMANTICS(TYPE) static INLINE UNUSED TYPE
676 # define EXTERN_SEMANTICS_P 0
677 #else
678 # define INLINE_SEMANTICS(TYPE) static UNUSED TYPE
679 # define EXTERN_SEMANTICS_P 0
680 #endif
681 #else
682 # define INLINE_SEMANTICS(TYPE) TYPE
683 # define EXTERN_SEMANTICS_P 1
684 #endif
686 #if EXTERN_SEMANTICS_P
687 # define EXTERN_SEMANTICS(TYPE) TYPE
688 #else
689 # define EXTERN_SEMANTICS(TYPE) static UNUSED TYPE
690 #endif
692 #if (SEMANTICS_INLINE & INLINE_LOCALS)
693 # define STATIC_INLINE_SEMANTICS(TYPE) static INLINE TYPE
694 #else
695 # define STATIC_INLINE_SEMANTICS(TYPE) static TYPE
696 #endif
698 #define STATIC_SEMANTICS(TYPE) static TYPE
702 /* support */
704 #if !defined (SUPPORT_INLINE) && (DEFAULT_INLINE)
705 # define SUPPORT_INLINE ALL_C_INLINE
706 #endif
708 #if ((H_REVEALS_MODULE_P (SUPPORT_INLINE) || defined (SIM_INLINE_C)) \
709 && !defined (SUPPORT_C) \
710 && (REVEAL_MODULE_P (SUPPORT_INLINE)))
711 # if (SUPPORT_INLINE & INLINE_GLOBALS)
712 # define INLINE_SUPPORT(TYPE) static INLINE UNUSED TYPE
713 # define EXTERN_SUPPORT_P 0
714 #else
715 # define INLINE_SUPPORT(TYPE) static UNUSED TYPE
716 # define EXTERN_SUPPORT_P 0
717 #endif
718 #else
719 # define INLINE_SUPPORT(TYPE) TYPE
720 # define EXTERN_SUPPORT_P 1
721 #endif
723 #if (SUPPORT_INLINE & INLINE_LOCALS)
724 # define STATIC_INLINE_SUPPORT(TYPE) static INLINE TYPE
725 #else
726 # define STATIC_INLINE_SUPPORT(TYPE) static TYPE
727 #endif
729 #define STATIC_SUPPORT(TYPE) static TYPE
733 #endif