gmp-utils: New API to simply use of GMP's integer/rational/float objects
[binutils-gdb.git] / sim / common / sim-inline.h
blobb2a27b697a93e04f04f51e51dd7031e19faac8c9
1 /* The common simulator framework for GDB, the GNU Debugger.
3 Copyright 2002-2020 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
27 /* INLINE CODE SELECTION:
29 GCC -O3 attempts to inline any function or procedure in scope. The
30 options below facilitate finer grained control over what is and
31 what is not inlined. In particular, it allows the selection of
32 modules for inlining. Doing this allows the compiler to both
33 eliminate the overhead of function calls and (as a consequence)
34 also eliminate further dead code.
36 On a CISC (x86) I've found that I can achieve an order of magnitude
37 speed improvement (x3-x5). In the case of RISC (sparc) while the
38 performance gain isn't as great it is still significant.
40 Each module is controled by the macro <module>_INLINE which can
41 have the values described below
43 0 (ZERO)
45 Do not inline any thing for the given module
47 The following bit fields values can be combined:
49 H_REVEALS_MODULE:
50 C_REVEALS_MODULE:
52 Include the C file for the module into the file being
53 compiled. The actual inlining is controlled separatly.
55 While of no apparent benefit, this makes it possible for the
56 included module, when compiled, to inline its calls to what
57 would otherwize be external functions.
59 {C_,H_} Determines where the module is inlined. A
60 H_REVEALS_MODULE will be included everywhere.
62 INLINE_GLOBALS:
64 Make external functions within the module `inline'. Thus if
65 the module is included into a file being compiled, calls to
66 the included modules funtions can be eliminated. INLINE_MODULE
67 implies REVEAL_MODULE.
69 INLINE_LOCALS:
71 Make internal (static) functions within the module `inline'.
74 CODING STYLE:
76 The inline ability is enabled by specifying every data and function
77 declaration and definition using one of the following methods:
80 GLOBAL INLINE FUNCTIONS:
82 Such functions are small and used heavily. Inlining them
83 will eliminate an unnecessary function call overhead.
85 .h: INLINE_OURPKG (void) ourpkg_func
86 (int x,
87 int y);
89 .c: INLINE_OURPKG (void)
90 ourpkg_func (int x,
91 int y)
93 ...
97 GLOBAL INLINE VARIABLES:
99 This doesn't make much sense.
102 GLOBAL NON-INLINE (EXTERN) FUNCTIONS AND VARIABLES:
104 These include functions with varargs parameters. It can
105 also include large rarely used functions that contribute
106 little when inlined.
108 .h: extern int ourpkg_print
109 (char *fmt, ...);
110 extern int a_global_variable;
112 .c: #if EXTERN_OURPKG_P
114 ourpkg_print (char *fmt,
115 ...)
119 #endif
120 #if EXTERN_OURPKG_P
121 int a_global_variable = 1;
122 #endif
125 LOCAL (STATIC) FUNCTIONS:
127 These can either be marked inline or just static static vis:
129 .h: STATIC_INLINE_OURPKG (int) ourpkg_staticf (void);
130 .c: STATIC_INLINE_OURPKG (int)
131 ourpkg_staticf (void)
136 .h: STATIC_OURPKG (int) ourpkg_staticf (void);
137 .c: STATIC_OURPKG (int)
138 ourpkg_staticf (void)
144 All .h files:
147 All modules must wrap their .h code in the following:
149 #ifndef OURPKG_H
150 #define OURPKG_H
151 ... code proper ...
152 #endif
154 In addition, modules that want to allow global inlining must
155 include the lines (below) at the end of the .h file. (FIXME:
156 Shouldn't be needed).
158 #if H_REVEALS_MODULE_P (OURPKG_INLINE)
159 #include "ourpkg.c"
160 #endif
163 All .c files:
165 All modules must wrap their .c code in the following
167 #ifndef OURPKG_C
168 #define OURPKG_C
169 ... code proper ...
170 #endif
173 NOW IT WORKS:
177 Since no inlining is defined. All macro's get standard defaults
178 (extern, static, ...).
182 H_REVEALS_MODULE (alt includes our):
185 altprog.c defines ALTPROG_C and then includes sim-inline.h.
187 In sim-inline.h the expression `` H_REVEALS_MODULE_P
188 (OURPROG_INLINE) && ! defined (OURPROG_C) && REVEAL_MODULE_P
189 (OURPROG_INLINE) '' is TRUE so it defines *_OURPROG as static
190 and EXTERN_OURPROG_P as FALSE.
192 altprog.c includes ourprog.h.
194 In ourprog.h the expression ``H_REVEALS_MODULE_P
195 (OURPROG_INLINE)'' is TRUE so it includes ourprog.c.
197 Consequently, all the code in ourprog.c is visible and static in
198 the file altprog.c
202 H_REVEALS_MODULE (our includes our):
205 ourprog.c defines OURPROG_C and then includes sim-inline.h.
207 In sim-inline.h the term `` ! defined (OURPROG_C) '' is FALSE so
208 it defines *_OURPROG as non-static and EXTERN_OURPROG_P as TRUE.
210 ourprog.c includes ourprog.h.
212 In ourprog.h the expression ``H_REVEALS_MODULE_P
213 (OURPROG_INLINE)'' is true so it includes ourprog.c.
215 In ourprog.c (second include) the expression defined (OURPROG_C)
216 and so the body is not re-included.
218 Consequently, ourprog.o will contain a non-static copy of all
219 the exported symbols.
223 C_REVEALS_MODULE (alt includes our):
226 altprog.c defines ALTPROG_C and then includes sim-inline.c
228 sim-inline.c defines C_INLINE_C and then includes sim-inline.h
230 In sim-inline.h the expression `` defined (SIM_INLINE) && !
231 defined (OURPROG_C) && REVEAL_MODULE_P (OURPROG_INLINE) '' is
232 true so it defines *_OURPROG as static and EXTERN_OURPROG_P as
233 FALSE.
235 In sim-inline.c the expression ``C_REVEALS_MODULE_P
236 (OURPROG_INLINE)'' is true so it includes ourprog.c.
238 Consequently, all the code in ourprog.c is visible and static in
239 the file altprog.c.
243 C_REVEALS_MODULE (our includes our):
246 ourprog.c defines OURPROG_C and then includes sim-inline.c
248 sim-inline.c defines C_INLINE_C and then includes sim-inline.h
250 In sim-inline.h the term `` ! defined (OURPROG_C) '' is FALSE
251 so it defines *_OURPROG as non-static and EXTERN_OURPROG_P as
252 TRUE.
254 Consequently, ourprog.o will contain a non-static copy of all
255 the exported symbols.
259 REALITY CHECK:
261 This is not for the faint hearted. I've seen GCC get up to 500mb
262 trying to compile what this can create. */
264 #define H_REVEALS_MODULE 1
265 #define C_REVEALS_MODULE 2
266 #define INLINE_GLOBALS 4
267 #define INLINE_LOCALS 8
269 #define ALL_H_INLINE (H_REVEALS_MODULE | INLINE_GLOBALS | INLINE_LOCALS)
270 #define ALL_C_INLINE (C_REVEALS_MODULE | INLINE_GLOBALS | INLINE_LOCALS)
273 /* Default macro to simplify control several of key the inlines */
275 #ifndef DEFAULT_INLINE
276 #define DEFAULT_INLINE INLINE_LOCALS
277 #endif
279 #define REVEAL_MODULE_P(X) (X & (H_REVEALS_MODULE | C_REVEALS_MODULE))
280 #define H_REVEALS_MODULE_P(X) ((X & H_REVEALS_MODULE))
281 #define C_REVEALS_MODULE_P(X) ((X & C_REVEALS_MODULE))
284 #ifndef HAVE_INLINE
285 #ifdef __GNUC__
286 #define HAVE_INLINE
287 #endif
288 #endif
291 /* Your compilers inline prefix */
293 #ifndef INLINE
294 #if defined (__GNUC__) && defined (__OPTIMIZE__)
295 #define INLINE __inline__
296 #else
297 #define INLINE /*inline*/
298 #endif
299 #endif
301 /* ??? Temporary, pending decision to always use extern inline and do a vast
302 cleanup of inline support. */
303 #ifndef INLINE2
304 #if defined (__GNUC_GNU_INLINE__) || defined (__GNUC_STDC_INLINE__)
305 #define INLINE2 __inline__ __attribute__ ((__gnu_inline__))
306 #elif defined (__GNUC__)
307 #define INLINE2 __inline__
308 #else
309 #define INLINE2 /*inline*/
310 #endif
311 #endif
314 /* Your compiler's static inline prefix */
316 #ifndef STATIC_INLINE
317 #define STATIC_INLINE static INLINE
318 #endif
321 /* Your compiler's extern inline prefix */
323 #ifndef EXTERN_INLINE
324 #define EXTERN_INLINE extern INLINE2
325 #endif
328 /* Your compiler's no-return reserved word */
330 #ifndef NORETURN
331 #define NORETURN
332 #endif
336 /* Your compilers's unused reserved word */
338 #if !defined (UNUSED)
339 #if (!defined (__GNUC__) \
340 || (__GNUC__ < 2) \
341 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7))
342 #define UNUSED
343 #else
344 #define UNUSED __attribute__((__unused__))
345 #endif
346 #endif
352 /* sim_arange */
354 #if !defined (SIM_ARANGE_INLINE) && (DEFAULT_INLINE)
355 # define SIM_ARANGE_INLINE (ALL_H_INLINE)
356 #endif
358 #if ((H_REVEALS_MODULE_P (SIM_ARANGE_INLINE) || defined (SIM_INLINE_C)) \
359 && !defined (SIM_ARANGE_C) \
360 && (REVEAL_MODULE_P (SIM_ARANGE_INLINE)))
361 # if (SIM_ARANGE_INLINE & INLINE_GLOBALS)
362 # define INLINE_SIM_ARANGE(TYPE) static INLINE TYPE UNUSED
363 # define EXTERN_SIM_ARANGE_P 0
364 # else
365 # define INLINE_SIM_ARANGE(TYPE) static TYPE UNUSED
366 # define EXTERN_SIM_ARANGE_P 0
367 # endif
368 #else
369 # define INLINE_SIM_ARANGE(TYPE) TYPE
370 # define EXTERN_SIM_ARANGE_P 1
371 #endif
373 #if (SIM_ARANGE_INLINE & INLINE_LOCALS)
374 # define STATIC_INLINE_SIM_ARANGE(TYPE) static INLINE TYPE
375 #else
376 # define STATIC_INLINE_SIM_ARANGE(TYPE) static TYPE
377 #endif
379 #define STATIC_SIM_ARANGE(TYPE) static TYPE
383 /* *****
384 sim-bits and sim-endian are treated differently from the rest
385 of the modules below. Their default value is ALL_H_INLINE.
386 The rest are ALL_C_INLINE. Don't blink, you'll miss it!
387 *****
390 /* sim-bits */
392 #if !defined (SIM_BITS_INLINE) && (DEFAULT_INLINE)
393 # define SIM_BITS_INLINE (ALL_H_INLINE)
394 #endif
396 #if ((H_REVEALS_MODULE_P (SIM_BITS_INLINE) || defined (SIM_INLINE_C)) \
397 && !defined (SIM_BITS_C) \
398 && (REVEAL_MODULE_P (SIM_BITS_INLINE)))
399 # if (SIM_BITS_INLINE & INLINE_GLOBALS)
400 # define INLINE_SIM_BITS(TYPE) static INLINE TYPE UNUSED
401 # define EXTERN_SIM_BITS_P 0
402 # else
403 # define INLINE_SIM_BITS(TYPE) static TYPE UNUSED
404 # define EXTERN_SIM_BITS_P 0
405 # endif
406 #else
407 # define INLINE_SIM_BITS(TYPE) TYPE
408 # define EXTERN_SIM_BITS_P 1
409 #endif
411 #if (SIM_BITS_INLINE & INLINE_LOCALS)
412 # define STATIC_INLINE_SIM_BITS(TYPE) static INLINE TYPE
413 #else
414 # define STATIC_INLINE_SIM_BITS(TYPE) static TYPE
415 #endif
417 #define STATIC_SIM_BITS(TYPE) static TYPE
421 /* sim-core */
423 #if !defined (SIM_CORE_INLINE) && (DEFAULT_INLINE)
424 # define SIM_CORE_INLINE ALL_C_INLINE
425 #endif
427 #if ((H_REVEALS_MODULE_P (SIM_CORE_INLINE) || defined (SIM_INLINE_C)) \
428 && !defined (SIM_CORE_C) \
429 && (REVEAL_MODULE_P (SIM_CORE_INLINE)))
430 # if (SIM_CORE_INLINE & INLINE_GLOBALS)
431 # define INLINE_SIM_CORE(TYPE) static INLINE TYPE UNUSED
432 # define EXTERN_SIM_CORE_P 0
433 #else
434 # define INLINE_SIM_CORE(TYPE) static TYPE UNUSED
435 # define EXTERN_SIM_CORE_P 0
436 #endif
437 #else
438 # define INLINE_SIM_CORE(TYPE) TYPE
439 # define EXTERN_SIM_CORE_P 1
440 #endif
442 #if (SIM_CORE_INLINE & INLINE_LOCALS)
443 # define STATIC_INLINE_SIM_CORE(TYPE) static INLINE TYPE
444 #else
445 # define STATIC_INLINE_SIM_CORE(TYPE) static TYPE
446 #endif
448 #define STATIC_SIM_CORE(TYPE) static TYPE
452 /* sim-endian */
454 #if !defined (SIM_ENDIAN_INLINE) && (DEFAULT_INLINE)
455 # define SIM_ENDIAN_INLINE ALL_H_INLINE
456 #endif
458 #if ((H_REVEALS_MODULE_P (SIM_ENDIAN_INLINE) || defined (SIM_INLINE_C)) \
459 && !defined (SIM_ENDIAN_C) \
460 && (REVEAL_MODULE_P (SIM_ENDIAN_INLINE)))
461 # if (SIM_ENDIAN_INLINE & INLINE_GLOBALS)
462 # define INLINE_SIM_ENDIAN(TYPE) static INLINE TYPE UNUSED
463 # define EXTERN_SIM_ENDIAN_P 0
464 # else
465 # define INLINE_SIM_ENDIAN(TYPE) static TYPE UNUSED
466 # define EXTERN_SIM_ENDIAN_P 0
467 # endif
468 #else
469 # define INLINE_SIM_ENDIAN(TYPE) TYPE
470 # define EXTERN_SIM_ENDIAN_P 1
471 #endif
473 #if (SIM_ENDIAN_INLINE & INLINE_LOCALS)
474 # define STATIC_INLINE_SIM_ENDIAN(TYPE) static INLINE TYPE
475 #else
476 # define STATIC_INLINE_SIM_ENDIAN(TYPE) static TYPE
477 #endif
479 #define STATIC_SIM_ENDIAN(TYPE) static TYPE
483 /* sim-events */
485 #if !defined (SIM_EVENTS_INLINE) && (DEFAULT_INLINE)
486 # define SIM_EVENTS_INLINE ALL_C_INLINE
487 #endif
489 #if ((H_REVEALS_MODULE_P (SIM_EVENTS_INLINE) || defined (SIM_INLINE_C)) \
490 && !defined (SIM_EVENTS_C) \
491 && (REVEAL_MODULE_P (SIM_EVENTS_INLINE)))
492 # if (SIM_EVENTS_INLINE & INLINE_GLOBALS)
493 # define INLINE_SIM_EVENTS(TYPE) static INLINE TYPE UNUSED
494 # define EXTERN_SIM_EVENTS_P 0
495 # else
496 # define INLINE_SIM_EVENTS(TYPE) static TYPE UNUSED
497 # define EXTERN_SIM_EVENTS_P 0
498 # endif
499 #else
500 # define INLINE_SIM_EVENTS(TYPE) TYPE
501 # define EXTERN_SIM_EVENTS_P 1
502 #endif
504 #if (SIM_EVENTS_INLINE & INLINE_LOCALS)
505 # define STATIC_INLINE_SIM_EVENTS(TYPE) static INLINE TYPE
506 #else
507 # define STATIC_INLINE_SIM_EVENTS(TYPE) static TYPE
508 #endif
510 #define STATIC_SIM_EVENTS(TYPE) static TYPE
514 /* sim-fpu */
516 #if !defined (SIM_FPU_INLINE) && (DEFAULT_INLINE)
517 # define SIM_FPU_INLINE ALL_C_INLINE
518 #endif
520 #if ((H_REVEALS_MODULE_P (SIM_FPU_INLINE) || defined (SIM_INLINE_C)) \
521 && !defined (SIM_FPU_C) \
522 && (REVEAL_MODULE_P (SIM_FPU_INLINE)))
523 # if (SIM_FPU_INLINE & INLINE_GLOBALS)
524 # define INLINE_SIM_FPU(TYPE) static INLINE TYPE UNUSED
525 # define EXTERN_SIM_FPU_P 0
526 # else
527 # define INLINE_SIM_FPU(TYPE) static TYPE UNUSED
528 # define EXTERN_SIM_FPU_P 0
529 # endif
530 #else
531 # define INLINE_SIM_FPU(TYPE) TYPE
532 # define EXTERN_SIM_FPU_P 1
533 #endif
535 #if (SIM_FPU_INLINE & INLINE_LOCALS)
536 # define STATIC_INLINE_SIM_FPU(TYPE) static INLINE TYPE
537 #else
538 # define STATIC_INLINE_SIM_FPU(TYPE) static TYPE
539 #endif
541 #define STATIC_SIM_FPU(TYPE) static TYPE
545 /* sim-types */
547 #if ((H_REVEALS_MODULE_P (SIM_TYPES_INLINE) || defined (SIM_INLINE_C)) \
548 && !defined (SIM_TYPES_C) \
549 && (REVEAL_MODULE_P (SIM_TYPES_INLINE)))
550 # if (SIM_TYPES_INLINE & INLINE_GLOBALS)
551 # define INLINE_SIM_TYPES(TYPE) static INLINE TYPE UNUSED
552 # define EXTERN_SIM_TYPES_P 0
553 # else
554 # define INLINE_SIM_TYPES(TYPE) static TYPE UNUSED
555 # define EXTERN_SIM_TYPES_P 0
556 # endif
557 #else
558 # define INLINE_SIM_TYPES(TYPE) TYPE
559 # define EXTERN_SIM_TYPES_P 1
560 #endif
562 #if (SIM_TYPES_INLINE & INLINE_LOCALS)
563 # define STATIC_INLINE_SIM_TYPES(TYPE) static INLINE TYPE
564 #else
565 # define STATIC_INLINE_SIM_TYPES(TYPE) static TYPE
566 #endif
568 #define STATIC_SIM_TYPES(TYPE) static TYPE
572 /* sim_main */
574 #if !defined (SIM_MAIN_INLINE) && (DEFAULT_INLINE)
575 # define SIM_MAIN_INLINE (ALL_C_INLINE)
576 #endif
578 #if ((H_REVEALS_MODULE_P (SIM_MAIN_INLINE) || defined (SIM_INLINE_C)) \
579 && !defined (SIM_MAIN_C) \
580 && (REVEAL_MODULE_P (SIM_MAIN_INLINE)))
581 # if (SIM_MAIN_INLINE & INLINE_GLOBALS)
582 # define INLINE_SIM_MAIN(TYPE) static INLINE TYPE UNUSED
583 # define EXTERN_SIM_MAIN_P 0
584 # else
585 # define INLINE_SIM_MAIN(TYPE) static TYPE UNUSED
586 # define EXTERN_SIM_MAIN_P 0
587 # endif
588 #else
589 # define INLINE_SIM_MAIN(TYPE) TYPE
590 # define EXTERN_SIM_MAIN_P 1
591 #endif
593 #if (SIM_MAIN_INLINE & INLINE_LOCALS)
594 # define STATIC_INLINE_SIM_MAIN(TYPE) static INLINE TYPE
595 #else
596 # define STATIC_INLINE_SIM_MAIN(TYPE) static TYPE
597 #endif
599 #define STATIC_SIM_MAIN(TYPE) static TYPE
601 /* engine */
603 #if ((H_REVEALS_MODULE_P (ENGINE_INLINE) || defined (SIM_INLINE_C)) \
604 && !defined (ENGINE_C) \
605 && (REVEAL_MODULE_P (ENGINE_INLINE)))
606 # if (ENGINE_INLINE & INLINE_GLOBALS)
607 # define INLINE_ENGINE(TYPE) static INLINE TYPE UNUSED
608 # define EXTERN_ENGINE_P 0
609 # else
610 # define INLINE_ENGINE(TYPE) static TYPE UNUSED
611 # define EXTERN_ENGINE_P 0
612 # endif
613 #else
614 # define INLINE_ENGINE(TYPE) TYPE
615 # define EXTERN_ENGINE_P 1
616 #endif
618 #if (ENGINE_INLINE & INLINE_LOCALS)
619 # define STATIC_INLINE_ENGINE(TYPE) static INLINE TYPE
620 #else
621 # define STATIC_INLINE_ENGINE(TYPE) static TYPE
622 #endif
624 #define STATIC_ENGINE(TYPE) static TYPE
628 /* icache */
630 #if ((H_REVEALS_MODULE_P (ICACHE_INLINE) || defined (SIM_INLINE_C)) \
631 && !defined (ICACHE_C) \
632 && (REVEAL_MODULE_P (ICACHE_INLINE)))
633 # if (ICACHE_INLINE & INLINE_GLOBALS)
634 # define INLINE_ICACHE(TYPE) static INLINE TYPE UNUSED
635 # define EXTERN_ICACHE_P 0
636 #else
637 # define INLINE_ICACHE(TYPE) static TYPE UNUSED
638 # define EXTERN_ICACHE_P 0
639 #endif
640 #else
641 # define INLINE_ICACHE(TYPE) TYPE
642 # define EXTERN_ICACHE_P 1
643 #endif
645 #if (ICACHE_INLINE & INLINE_LOCALS)
646 # define STATIC_INLINE_ICACHE(TYPE) static INLINE TYPE
647 #else
648 # define STATIC_INLINE_ICACHE(TYPE) static TYPE
649 #endif
651 #define STATIC_ICACHE(TYPE) static TYPE
655 /* idecode */
657 #if ((H_REVEALS_MODULE_P (IDECODE_INLINE) || defined (SIM_INLINE_C)) \
658 && !defined (IDECODE_C) \
659 && (REVEAL_MODULE_P (IDECODE_INLINE)))
660 # if (IDECODE_INLINE & INLINE_GLOBALS)
661 # define INLINE_IDECODE(TYPE) static INLINE TYPE UNUSED
662 # define EXTERN_IDECODE_P 0
663 #else
664 # define INLINE_IDECODE(TYPE) static TYPE UNUSED
665 # define EXTERN_IDECODE_P 0
666 #endif
667 #else
668 # define INLINE_IDECODE(TYPE) TYPE
669 # define EXTERN_IDECODE_P 1
670 #endif
672 #if (IDECODE_INLINE & INLINE_LOCALS)
673 # define STATIC_INLINE_IDECODE(TYPE) static INLINE TYPE
674 #else
675 # define STATIC_INLINE_IDECODE(TYPE) static TYPE
676 #endif
678 #define STATIC_IDECODE(TYPE) static TYPE
682 /* semantics */
684 #if ((H_REVEALS_MODULE_P (SEMANTICS_INLINE) || defined (SIM_INLINE_C)) \
685 && !defined (SEMANTICS_C) \
686 && (REVEAL_MODULE_P (SEMANTICS_INLINE)))
687 # if (SEMANTICS_INLINE & INLINE_GLOBALS)
688 # define INLINE_SEMANTICS(TYPE) static INLINE TYPE UNUSED
689 # define EXTERN_SEMANTICS_P 0
690 #else
691 # define INLINE_SEMANTICS(TYPE) static TYPE UNUSED
692 # define EXTERN_SEMANTICS_P 0
693 #endif
694 #else
695 # define INLINE_SEMANTICS(TYPE) TYPE
696 # define EXTERN_SEMANTICS_P 1
697 #endif
699 #if EXTERN_SEMANTICS_P
700 # define EXTERN_SEMANTICS(TYPE) TYPE
701 #else
702 # define EXTERN_SEMANTICS(TYPE) static TYPE UNUSED
703 #endif
705 #if (SEMANTICS_INLINE & INLINE_LOCALS)
706 # define STATIC_INLINE_SEMANTICS(TYPE) static INLINE TYPE
707 #else
708 # define STATIC_INLINE_SEMANTICS(TYPE) static TYPE
709 #endif
711 #define STATIC_SEMANTICS(TYPE) static TYPE
715 /* support */
717 #if !defined (SUPPORT_INLINE) && (DEFAULT_INLINE)
718 # define SUPPORT_INLINE ALL_C_INLINE
719 #endif
721 #if ((H_REVEALS_MODULE_P (SUPPORT_INLINE) || defined (SIM_INLINE_C)) \
722 && !defined (SUPPORT_C) \
723 && (REVEAL_MODULE_P (SUPPORT_INLINE)))
724 # if (SUPPORT_INLINE & INLINE_GLOBALS)
725 # define INLINE_SUPPORT(TYPE) static INLINE TYPE UNUSED
726 # define EXTERN_SUPPORT_P 0
727 #else
728 # define INLINE_SUPPORT(TYPE) static TYPE UNUSED
729 # define EXTERN_SUPPORT_P 0
730 #endif
731 #else
732 # define INLINE_SUPPORT(TYPE) TYPE
733 # define EXTERN_SUPPORT_P 1
734 #endif
736 #if (SUPPORT_INLINE & INLINE_LOCALS)
737 # define STATIC_INLINE_SUPPORT(TYPE) static INLINE TYPE
738 #else
739 # define STATIC_INLINE_SUPPORT(TYPE) static TYPE
740 #endif
742 #define STATIC_SUPPORT(TYPE) static TYPE
746 #endif